respondcreate / django-versatileimagefield

A drop-in replacement for django's ImageField that provides a flexible, intuitive and easily-extensible interface for quickly creating new images from the one assigned to the field.
http://django-versatileimagefield.readthedocs.io/
MIT License
531 stars 88 forks source link

Found a GIF file that causes exception while cropping #76

Open Alex-Sichkar opened 8 years ago

Alex-Sichkar commented 8 years ago

-order Seems like attached file has incorrect palette or something. Exception raised here: https://github.com/respondcreate/django-versatileimagefield/blob/master/versatileimagefield/versatileimagefield.py#L142

In [62]: palette = im.getpalette()
In [63]: im.putpalette(palette)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-63-46e38e31e923> in <module>()
----> 1 im.putpalette(palette)

/home/vitaliy/.virtualenvs/1.9/local/lib/python2.7/site-packages/PIL/Image.pyc in putpalette(self, data, rawmode)
  1473             if not isinstance(data, bytes):
  1474                 if bytes is str:
-> 1475                     data = "".join(chr(x) for x in data)
  1476                 else:
  1477                     data = bytes(data)

TypeError: 'NoneType' object is not iterable