[Image-SIG] Installing libjpeg

Mark Twenhafel chollapete at gmail.com
Fri May 14 17:31:04 CEST 2010

On Fri, May 14, 2010 at 8:22 AM, Mark Twenhafel <chollapete at gmail.com>wrote:

> Hi--
> Follow-up to yesterday's question.  Also, thanks to Fredrik Lundh for
> off-list assistance.  At one point, I was momentarily speechless when I
> turned from an email back to the documentation I was reading and noticed
> that both were authored by the same, Mr. Lundh.  :-)
> From yesterday, I progressed to attempting to create an image object from
> within the Python interpreter using the call
> ImageTk.PhotoImage(file="filename.jpg").  This call threw an exception:
> "IOError: decoder jpeg not available" at line 375 in _getdecoder;
> specifically, "raise IOError("decoder %s not available" % decoder_name)" in
> file
> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/Image.py".
> Mr Lundh offered this advice:
> This usually indicates that you've ended up with multiple _imaging.so
> binaries on the machine, and that the test and your script picks up
> different ones.
> Try adding
>    print Image.core.__file__
> to your script and make sure that the output is what you expect.
> At this point, my working hypothesis is that I did not install libjpeg
> correctly.  I'm working on OS X Tiger.  What I did was download
> "jpegsrc.v8a.tar.gz"; double-click in my download window in Firefox to
> untar; move the untarred "jpeg-8" folder to /Application; open Terminal and
> cd'ed to /Applications/jpeg-8; finally, I ran "./configure", "make", and
> "make install".
> It could be--and I don't know--that this install procedure did not
> correctly add libjpeg to my Python 2.6 installation or that I need to
> rebuild site-packages/PIL/_imaging.so in order to link-in libjpeg.  Any
> direction would be appreciated.
> Thanks.
> Mark T.

Belated point of clarification: I subsequently installed PIL using the these
        $ cd Imaging-1.1.7
        $ python setup.py build_ext -i
        $ python selftest.py

I just noticed that the file "site-packages/PIL/_imaging.so" was created
last October.  If so, would be be possible or likely that this was built
using the version of libjpeg that didn't install on my machine?  If this is
correct, what is the best way to proceed?  My first inclination is to delete
the directory site-packages/PIL and reinstall.  Good or bad idea?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/image-sig/attachments/20100514/1ba28fcb/attachment.html>

More information about the Image-SIG mailing list