JPEG decoder not available in PIL

Peter peter at monicol.co.uk
Tue Dec 6 17:02:37 EST 2005


I have a problem which seems to come up from time to time but I can't
find anything relevant in the archives.  I have used PIL v1.1.5 with no
problem on Windows for some time but now wish to put it on Linux (Suse
Linux v10.0). I obtained and built the JPEG libraries (jpeg-6b) without
any problem. The tests for the installation work fine. I built Python
2.4.2 from the sources but with no special options, just 'out of the
box'. This works fine. PIL built as it should but the selftest.py fails
with the  ‘'decoder jpeg is not available'’ message (the other 54
tests are OK). Other images are opened and shown with xv, no problem. I
think that there is something wrong with the libraries or the way they
linked.  ....

At the last moment I managed to solve this problem and I hope it is
worth supplying the details here. First there is a file in the install
directory libImaging/Jpeg.h which has a line:

    #include "jpeglib.h"

but there is no such header file. On my system I put:

    #include "/usr/local/include/jpeglib.h"

 which is where the JPEG installation put the include files for the
library. With this change all 55 tests passed successfully. Then I
copied the PIL library from the installation directory where it was
built to the Python site-packages location. And then everything worked.
For some reason it was not enough to do python setup.py install but
this is probably an artifact of previous failures.
 
 Hope this helps someone ...
 
 Peter




More information about the Python-list mailing list