[Zope] PIL and JPG encoder.

Tom Cameron tom@mooball.com
Mon, 23 Jul 2001 10:11:05 +1000


I know this is mostly a python/PIL question, but I figured someone here may
have experienced this. I am using FreeBSD4.0, Python1.5.2

I am trying to use PIL to manipulate Zope images.

I already have the IJG jpeg-6b library installed. I then successfully (at
least it looked successful) built and installed PIL.

PIL works fine for all image formats except JPEG. For JPEG it gives me the
following error:
>>> image.save("newimage","JPEG")
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "PIL/Image.py", line 720, in save
    SAVE[string.upper(format)](self, fp, filename)
  File "PIL/JpegImagePlugin.py", line 306, in _save
    ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)])
  File "PIL/ImageFile.py", line 369, in _save
    e = Image._getencoder(im.mode, e, a, im.encoderconfig)
  File "PIL/Image.py", line 259, in _getencoder
    raise IOError, "encoder %s not available" % encoder_name
IOError: encoder jpeg not available
>>>

It looks to me like the jpeg library has not been bound? with PIL?.

I am very new as this sort of thing and I know almost nothing about building
from source and shared libraries, so I most probably did something stupid. I
checked the Setup file in the PIL build and it seems to point to the correct
directories for the jpeg library.

Any hints would be appreciated.

Thanks
Tom