[Image-SIG] some trouble about jpeg encode in PIL

feihu_roger feihu_roger at yahoo.com.cn
Fri Oct 27 11:28:16 CEST 2006


I use PIL to thumbnail and save one jpeg. raise one IOException:

>>> im= Image.open('e:/11.jpg')
>>> im.thumbnail((600,600))
>>> im.save('e:/11_m.jpg', 'JPEG', quality=90,progressive=1)

Traceback (most recent call last):
  File "<pyshell#74>", line 1, in -toplevel-
    im.save('e:/11_m.jpg', 'JPEG',   quality=90,progressive=1)
  File "D:\dev\Python24\Lib\site-packages\PIL\Image.py", line 1305, in save
    save_handler(self, fp, filename)
  File "D:\dev\Python24\lib\site-packages\PIL\JpegImagePlugin.py", line 409, in _save
    ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)])
  File "D:\dev\Python24\Lib\site-packages\PIL\ImageFile.py", line 491, in _save
    raise IOError("encoder error %d when writing image file" % s)
IOError: encoder error -2 when writing image file


but When i use :
>>> im.save('e:/11_m.jpg', 'JPEG', quality=90)
it work.

Roger

__________________________________________________
¸Ï¿ì×¢²áÑÅ»¢³¬´óÈÝÁ¿Ãâ·ÑÓÊÏä?
http://cn.mail.yahoo.com


More information about the Image-SIG mailing list