[Image-SIG] Problem with JPEG output

Ondrej Vlach ovlach at nanobyte.cz
Sat Mar 11 00:43:08 CET 2006

I have a little problem if I use optimize or progession with JPEG.

I have a simple source:

import Image
im = Image.open("/tmp/thumbnail.jpg")
im.save('/tmp/thumbnail2.jpg', "JPEG", optimize = 1)

which output this:

Suspension not allowed here
Traceback (most recent call last):
  File "test.py", line 5, in ?
    im.save('/tmp/thumbnail2.jpg', "JPEG", optimize = 1)
  File "/usr/lib/python2.4/site-packages/PIL/Image.py", line 1331, in save
    save_handler(self, fp, filename)
  File "/usr/lib/python2.4/site-packages/PIL/JpegImagePlugin.py", line 409, in 
    ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)])
  File "/usr/lib/python2.4/site-packages/PIL/ImageFile.py", line 493, in _save
    raise IOError("encoder error %d when writing image file" % s)
IOError: encoder error -2 when writing image file

version: Imaging-1.1.6a1-20051211

Anyone knowns why this source output this exception and how fix-it?

Btw: Sorry for my english
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://mail.python.org/pipermail/image-sig/attachments/20060311/0849ce64/attachment.pgp 

More information about the Image-SIG mailing list