Wednesday, December 23, 2015

Django :: IOError: encoder error -2 when writing image file

exceptions:IOError: encoder error -2 when writing image file

Traceback (most recent call last):
 File "/django_virtalenv//lib/python2.7/site-packages/newrelic-", line 492, in wrapper return wrapped(*args, **kwargs)
 File "/django_virtalenv//lib/python2.7/site-packages/django/contrib/admin/", line 465, in wrapper return self.admin_site.admin_view(view)(*args, **kwargs)
 File "/django_virtalenv//lib/python2.7/site-packages/django/utils/", line 99, in _wrapped_view response = view_func(request, *args, **kwargs)
 File "/django_virtalenv//lib/python2.7/site-packages/django/views/decorators/", line 52, in _wrapped_view_func response = view_func(request, *args, **kwargs)
 File "/django_virtalenv//lib/python2.7/site-packages/django/contrib/admin/", line 198, in inner return view(request, *args, **kwargs)
 File "/django_virtalenv//lib/python2.7/site-packages/django/utils/", line 29, in _wrapper return bound_func(*args, **kwargs)
 File "/django_virtalenv//lib/python2.7/site-packages/django/utils/", line 99, in _wrapped_view response = view_func(request, *args, **kwargs)
 File "/django_virtalenv//lib/python2.7/site-packages/django/utils/", line 25, in bound_func return func(self, *args2, **kwargs2)
 File "/django_virtalenv//lib/python2.7/site-packages/django/db/", line 371, in inner return func(*args, **kwargs)
 File "/django_virtalenv//lib/python2.7/site-packages/django/contrib/admin/", line 1263, in change_view self.save_model(request, new_object, form, True)
 File "/data/cms/trunk/cms/articles/", line 125, in save_model
 File "/django_virtalenv//lib/python2.7/site-packages/django/db/models/", line 545, in save force_update=force_update, update_fields=update_fields)
 File "/django_virtalenv//lib/python2.7/site-packages/django/db/models/", line 573, in save_base updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
 File "/django_virtalenv//lib/python2.7/site-packages/django/db/models/", line 632, in _save_table for f in non_pks]
 File "/django_virtalenv//lib/python2.7/site-packages/django/db/models/fields/", line 252, in pre_save, file, save=False)
 File "/data/cms/trunk/cms/utils/", line 93, in save thumb_content = generate_thumb( content, size, split[1] )
 File "/data/cms/trunk/cms/utils/", line 60, in generate_thumb io, "JPEG", quality = 90, optimize=True, progressive=True)
 File "/django_virtalenv//lib/python2.7/site-packages/PIL/", line 1439, in save save_handler(self, fp, filename)
 File "/django_virtalenv//lib/python2.7/site-packages/PIL/", line 471, in _save Image
 File._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)])
 File "/django_virtalenv//lib/python2.7/site-packages/PIL/Image", line 491, in _save raise IOError("encoder error %d when writing image file" % s)IOError: encoder error -2 when writing image file

Soln :- pip install Pillow

1 comment:

Wheelchair India said...

Hey, very nice site. I came across this on Google, and I am stoked that I did. I will definitely be coming back here more often. Wish I could add to the conversation and bring a bit more to the table, but am just taking in as much info as I can at the moment. Thanks for sharing.
BTE Hearing Aid Prices

Keep Posting:)