[Pythonmac-SIG] PIL and jpeg on MacOS X

Jerry LeVan jerry.levan at eku.edu
Thu May 13 20:30:00 EDT 2004


I don't seem to know the proper magical incantation to get
PIL to work with jpegs.

Today I installed the MacOS X Additions to my Mac running
10.3.3. I have already installed and use the Batteries Included
Aqua Tcl/Tk 8.4.5

I first tried some Tkinter examples ( after loading Tkinter from
the Configure Manager. Tkinter seems to work ok.

I tried adding PIL and noticed that jpegs did not work. I then
realized that libjpeg was not installed.

I installed libjpeg.dylib in /usr/local/bin tore out the old PIL
and asked config manager to reinstall...( I have to do the actual
install as root...) Everything seems there but any jpeg operation
fails generally with an error traceback
   File "imageview.py", line 13, in ?
     main()
   File "imageview.py", line 8, in main
     img = PhotoImage(file=filename)
   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 164, in paste
     im.load()
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/site-packages/PIL/ImageFile.py", line 165, in load
     d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/site-packages/PIL/Image.py", line 309, in _getdecoder
     raise IOError("decoder %s not available" % decoder_name)
IOError: decoder jpeg not available

What am I doing wrong?

Jerry




More information about the Pythonmac-SIG mailing list