Python Image Library IOError - cannot find JPEG decoder?

D

Dario Traverso

I've been trying to install the Python Image Library (PIL) on my Mac
OSX Leopard laptop, but have been running into some difficulties.

I've built the library, using the included setup.py script. The build
summary checks out ok, and sounds the option libraries to all be
found. I grabbed both libjpeg and freetype2 using fink.

--------------------------------------------------------------------
PIL 1.1.6 BUILD SUMMARY
--------------------------------------------------------------------
version 1.1.6
platform darwin 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)
[GCC 4.0.1 (Apple Inc. build 5465)]
--------------------------------------------------------------------
--- TKINTER support ok
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
--- FREETYPE2 support ok
--------------------------------------------------------------------

However, I then run the included self test, and 1 out of 57 tests
fails. I receive an IOError. Specifically:

*****************************************************************
Failure in example: _info(Image.open("Images/lena.jpg"))
from line #24 of selftest.testimage
Exception raised:
Traceback (most recent call last):
File "./doctest.py", line 499, in _run_examples_inner
exec compile(source, "<string>", "single") in globs
File "<string>", line 1, in <module>
File "./selftest.py", line 22, in _info
im.load()
File "PIL/ImageFile.py", line 180, in load
d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
File "PIL/Image.py", line 375, in _getdecoder
raise IOError("decoder %s not available" % decoder_name)
IOError: decoder jpeg not available
1 items had failures:
1 of 57 in selftest.testimage
***Test Failed*** 1 failures.
*** 1 tests of 57 failed.


I've followed all of the installation instructions exactly. The build
summary reported everything was "ok". What could be the problem here.
Libjpeg-6b is not accessible?

Thank you for any insight you can provide!!

-Dario
 
W

wongobongo

I've been trying to install the Python Image Library  (PIL) on my Mac  
OSX Leopard laptop, but have been running into some difficulties.

I've built the library, using the included setup.py  script. The build  
summary checks out ok, and sounds the option libraries to all be  
found. I grabbed both libjpeg and freetype2  using  fink.

--------------------------------------------------------------------
PIL 1.1.6 BUILD SUMMARY
--------------------------------------------------------------------
version       1.1.6
platform      darwin 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)
              [GCC 4.0.1 (Apple Inc. build 5465)]
--------------------------------------------------------------------
--- TKINTER support ok
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
--- FREETYPE2 support ok
--------------------------------------------------------------------

However,  I then run the included self test, and 1 out of 57 tests  
fails. I receive an IOError. Specifically:

*****************************************************************
Failure in example: _info(Image.open("Images/lena.jpg"))
from line #24 of selftest.testimage
Exception raised:
Traceback (most recent call last):
  File "./doctest.py", line 499, in _run_examples_inner
    exec compile(source, "<string>", "single") in globs
  File "<string>", line 1, in <module>
  File "./selftest.py", line 22, in _info
    im.load()
  File "PIL/ImageFile.py", line 180, in load
    d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
  File "PIL/Image.py", line 375, in _getdecoder
    raise IOError("decoder %s not available" % decoder_name)
IOError: decoder jpeg not available
1 items had failures:
   1 of  57 in selftest.testimage
***Test Failed*** 1 failures.
*** 1 tests of 57 failed.

I've followed all of the installation instructions exactly. The build  
summary reported everything was "ok". What could be the problem here.  
Libjpeg-6b  is not accessible?

Thank you for any insight you can provide!!

-Dario


That would be my guess.

Two things you may want to try:

1. Check that your Fink libraries and headers were used to make your
PIL (check -I and -L settings on gcc after doing "python setup.py
build_ext -i"). They should point to your Fink lib and include dirs.
2. Line 372 in PIL/Image.py has a debug print line. Try uncommenting
that and see what comes out.

That might give you some clues as to what is going on. You can always
just call up Python in a terminal and try it out (from selftest.py
doctests beginning on line 29).
.... im.load()
.... return im.format, im.mode, im.size(None, '1', (128, 128))
 
O

OdarR

I've been trying to install the Python Image Library  (PIL) on my Mac  
OSX Leopard laptop, but have been running into some difficulties.

I've built the library, using the included setup.py  script. The build  
summary checks out ok, and sounds the option libraries to all be  
found. I grabbed both libjpeg and freetype2  using  fink.

I did'nt build it, maybe you don't want too.
I used the PIL package for Python 2.5 listed here:
http://pythonmac.org/packages/py25-fat/index.html


hth,
Olivier
 
Z

Zvezdan Petkovic

It could be something obvious and something you have done, but it's
worth asking:

1. Do you have the path to fink binaries, such as djpeg,
in your shell PATH (e.g., /opt/local/bin for MacPorts)?

2. Did you set up the path to the libraries you linked with in the
environment variable DYLD_LIBRARY_PATH?
For example, DYLD_LIBRARY_PATH=/opt/local/lib for MacPorts

3. Did you execute your app with this variable available.

$ env DYLD_LIBRARY_PATH=/opt/local/lib your-app

Once you confirm what is missing you can write a Python wrapper
to call your app with the right environment.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top