logo       

Jpeg still broken?: msg#00083

python.apple

Subject: Jpeg still broken?

Well I installed the PIL located at http://undefined.org/python/pimp/
and now when I run one of the demo scripts:
#
# The Python Imaging Library
# $Id: //modules/pil/Scripts/viewer.py#2 $
#

from Tkinter import *
import Image, ImageTk

#
# an image viewer

class UI(Label):

def __init__(self, master, im):

if im.mode == "1":
# bitmap image
self.image = ImageTk.BitmapImage(im, foreground="white")
Label.__init__(self, master, image=self.image, bg="black", bd=0)

else:
# photo image
self.image = ImageTk.PhotoImage(im)
Label.__init__(self, master, image=self.image, bd=0)

#
# script interface

if __name__ == "__main__":

import sys

if not sys.argv[1:]:
print "Syntax: python viewer.py imagefile"
sys.exit(1)

filename = sys.argv[1]

root = Tk()
root.title(filename)

im = Image.open(filename)

UI(root, im).pack()

********
I get:
[macjerry:~/python]$ python Viewer.py FixedColor.JPEG
Traceback (most recent call last):
File "Viewer.py", line 44, in ?
UI(root, im).pack()
File "Viewer.py", line 23, in __init__
self.image = ImageTk.PhotoImage(im)
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/PIL/ImageTk.py", line 114, in __init__
self.paste(image)
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/PIL/ImageTk.py", line 179, in paste
import _imagingtk
ImportError: No module named _imagingtk

Any suggestions?

Jerry


_______________________________________________
Pythonmac-SIG maillist - Pythonmac-SIG@xxxxxxxxxx
http://mail.python.org/mailman/listinfo/pythonmac-sig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise