[Image-SIG] Re: PIL (libImaging) - Problems with jpeg decoder / libraries

Fredrik Lundh fredrik@pythonware.com
Thu, 22 May 2003 10:36:31 +0200

Robin Munt wrote:

> Spent the last day on this problem, not seeming to get
> anywhere with it, hopefully someone has some ideas -
> i've noticed that theres been a fair few posts with
> this problem, searched thru them, but couldn't find a
> solution

> In the libimaging directory i run
> prompt> configure --with-zlib=/usr/local/lib \
>                   --with-jpeg=/usr/local/lib
> This runs through the configure script which doesn't
> see the JPEG libraries (according to the screen
> output)
> "checking for jpeg_destroy_compress in -ljpeg...
> (cached) no"
> When I run the make, there are no JpegEncode.o or
> JpegDecode.o files

hmm.  sounds like you're slighly out of sync: those files should always
be built, even if the configure scripts cannot find the JPEG libs.

> OK, so i thought i'd edit the ImConfig.h by hand to
> pick up the JPEG libraries.  Added the line
> #define HAVE_LIBJPEG 1
> Then I ran the make, which created a JpegEncode.o and
> JpegDecode.o, but i'm certain that these haven't
> compiled correctly (they are too small).

which is what typically happens if the configure scripts don't find the
library...  (you can compare their size with Dib.o, which is always an
empty C file on Unix).

anyway, I've posted what I think is a complete recipe for how to get
JPEG/PNG support on platforms where PIL's configure scripts just don't
want to do the right thing:


let me know if it helps.