JPEG decoder not available in PIL
modelnine at bit-bukket.org
Wed Dec 7 06:32:24 CET 2005
> 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.
This is baaaaad! You're mixing two libraries here, for one the system jpeg
library and for another your library. Probably the dynamic loader cache
finds the system library first, so although you included the specifications
for the library you installed to /usr/local, you link against the system
library which might be different (in this case it is not and for jpeglib
will never be, but nevertheless, this is an absolute NONO).
PIL comes precompiled for SuSE, btw., and the package is called Imaging,
IIRC (long time since I've tried SuSE).
Next time round you want to install something, read up on the distinction
between <pkg> and <pkg>-devel. The former contains only the files necessary
at runtime (thus, no static libraries, no headers, etc.), while the latter
contains everything the package installs that isn't in the former. Thus, to
install PIL you should have done:
rpm -Uvv libjpeg-devel-<something>.rpm
using the SuSE package manager. Then the PIL intallation would have found
the appropriate header files and compiled successfully. Actually, you must
have installed python-devel for the installation package to succeed. Or did
you build Python yourself and overwrote the standard python that was
installed? If so, really do read up on package management using RPM,
there's quite a lot on this on SuSE's site. Otherwise you'll wreck your
system in the longrun...
More information about the Python-list