Skip to content

Instantly share code, notes, and snippets.

@imjaypatel
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imjaypatel/149359ce3382168f64b8 to your computer and use it in GitHub Desktop.
Save imjaypatel/149359ce3382168f64b8 to your computer and use it in GitHub Desktop.
Suspension not allowed here: IOError: encoder error -2 when writing image file
from PIL import ImageFile
ImageFile.MAXBLOCK = max(image.size) ** 2
Suspension not allowed here
2015-05-12 12:59:00,763 28865 ERROR hr openerp.addons.website.controllers.main: Failed to upload image to attachment
Traceback (most recent call last):
File "/home/jpa/odoo/master-old-hr/addons/website/controllers/main.py", line 321, in attach
image_data = image_save_for_web(image)
File "/home/jpa/odoo/master-old-hr/openerp/tools/image.py", line 141, in image_save_for_web
image.save(img, **opt)
File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1442, in save
save_handler(self, fp, filename)
File "/usr/lib/python2.7/dist-packages/PIL/JpegImagePlugin.py", line 475, in _save
ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)])
File "/usr/lib/python2.7/dist-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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment