Tareq Alam

i have promises to keep and miles to go before i sleep – Robert Frost

PIL: IOError: encoder jpeg not available June 2, 2009

Filed under: 1 — tareqalam @ 7:07 am
Tags: , , , , ,

I have got this error while doing this
import tempfile
bg_new=Image.new(‘RGB’,(486,236), GREEN)
tmp = tempfile.mktemp(suffix=’.%s’ % ‘jpg’)
bg_new.save(tmp, “JPEG”, quality=95)

I was looking for solution and got this:

in setup.py in Imaging-1.1.6 that is PIL 1.1.6
set this
JPEG_ROOT = “/usr/lib64″, “/usr/include”
then in terminal
python setup.py build –force
this will include libjpeg in PIL. before you may need to install libjpeg in your linux system. I have tried this with python2.4 in ubuntu 8.10
hope this works

 

Leave a Reply