Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Python Image Library IOError - cannot find JPEG decoder?

Reply
Thread Tools

Python Image Library IOError - cannot find JPEG decoder?

 
 
Dario Traverso
Guest
Posts: n/a
 
      02-24-2009
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
 
Reply With Quote
 
 
 
 
wongobongo
Guest
Posts: n/a
 
      02-25-2009
On Feb 24, 9:34*am, Dario Traverso <traver...@gmail.com> wrote:
> 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).

>>> import Image
>>> def _info(im):

.... im.load()
.... return im.format, im.mode, im.size
>>> im = Image.new("1", (128, 12)
>>> _info(im)

(None, '1', (128, 12)

 
Reply With Quote
 
 
 
 
Irmen de Jong
Guest
Posts: n/a
 
      02-25-2009
wongobongo wrote:
> On Feb 24, 9:34 am, Dario Traverso <traver...@gmail.com> wrote:
>> 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 a similar thing, but not using Fink, on my mac (running osx 10.4)
I documented the procedure I had to take to get it to work:
http://www.razorvine.net/frog/user/i...2008-08-02/127

It's in Dutch but you can probably figure it out.
I guess since you were on 10.5 that you have to adapt the
'DEPLOMENT_TARGET' variable in a suitable manner.

Hope it helps,

--irmen
 
Reply With Quote
 
OdarR
Guest
Posts: n/a
 
      02-25-2009
On 24 fév, 18:34, Dario Traverso <traver...@gmail.com> wrote:
> 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
 
Reply With Quote
 
Zvezdan Petkovic
Guest
Posts: n/a
 
      02-26-2009
> On Feb 24, 9:34 am, Dario Traverso <traver...@gmail.com> wrote:
>> 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 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?
>> That would be my guess.



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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IOError - cannot create file (linux daemon-invoked script) cassiope Python 16 01-06-2010 04:29 PM
URL as input -> "IOError: [Errno 2] The system cannot find the path specified" Gilles Ganault Python 2 10-24-2008 06:34 PM
Jpeg encoder exception: Trying to make a thumbail from a jpeg image in a byte[] lovaspillando Java 0 08-25-2007 11:21 PM
PIL problem: IOError: cannot identify image file h112211@gmail.com Python 2 08-20-2006 01:38 PM
image library for Java (WSQ image library for fingerprints) released info@cognaxon.com Java 0 07-19-2006 09:10 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57