Как сохранить прогрессивный JPEG с помощью Python PIL 1.1.7?

Я пытаюсь сохранить с помощью следующего вызова, и он вызывает ошибку, но если я удалю прогрессивные и оптимизирующие параметры, он сохраняет.

Вот мой тест. py, которая не работает:

import Image
img = Image.open("in.jpg")
img.save("out.jpg", "JPEG", quality=80, optimize=True, progressive=True)

Возникает такая ошибка:

Suspension not allowed here
Traceback (most recent call last):
  File "test.py", line 3, in 
    img.save("out.jpg", "JPEG", quality=80, optimize=True, progressive=True)
  File "/Library/Python/2.6/site-packages/PIL/Image.py", line 1439, in save
    save_handler(self, fp, filename)
  File "/Library/Python/2.6/site-packages/PIL/JpegImagePlugin.py", line 471, in _save
    ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)])
  File "/Library/Python/2.6/site-packages/PIL/ImageFile.py", line 501, in _save
    raise IOError("encoder error %d when writing image file" % s)
IOError: encoder error -2 when writing image file

Ссылка на изображение: http://static.cafe.nov.ru/in.jpg (4,3 мб)

20
задан Andrey Kuzmin 22 July 2011 в 10:55
поделиться