[Image-SIG] verifying pil libraries

Fredrik Lundh fredrik at pythonware.com
Mon Sep 25 19:09:14 CEST 2006

David Bear wrote:

> 1) how to clean up a pil installation that doesn't have the decoders
> that I need -- (do I need to remove the existing pil installation
> first)

to see what PIL core build a certain Python interpreter is using, do:

     >>> import Image
     >>> Image.core.__file__

make sure that Python interpreter you're running Zope with picks up the 
same core file (usually something/something/_imaging.so).

> 2) what tests are available to check an existing pil installation for
> decoders it has available


     >>> dir(Image.core)

and look for functions named xyz_decoder (e.g. jpeg_decoder, gif_decoder).

alternatively, just try to save an image as JPEG, and see what happens:

     >>> Image.new("L", (100, 100)).save("test.jpg")

> 3) what else do I need to install to make sure that pil has the
> libraries that it needs? Here's a list of jpeg libs I have installed
> via rpm's : rpm -qa | grep jpeg
> 	libjpeg-devel-32bit-9.3-7
> 	jpeg-6b-738
> 	libjpeg-32bit-9.3-7
> 	libjpeg-devel-6.2.0-4
> 	libjpeg-6.2.0-738

you need the header files, the build libraries, and the runtime 
libraries.  if PIL's selftest says that JPEG support is working, you 
clearly have them all; all you need to do is to make sure that the 
Python interpreter you want to use PIL from is finding the right
version of the _imaging.so file.

hope this helps!


More information about the Image-SIG mailing list