Fix exporting in GIF format in the legacy IM portability layer

This commit is contained in:
Kovid Goyal 2016-05-12 22:18:40 +05:30
parent 88ff4ae126
commit d149634ad4

View File

@ -141,7 +141,7 @@ class Image(object):
if fmt.lower() == 'gif': if fmt.lower() == 'gif':
data = image_to_data(self.img, fmt='PNG', png_compression_level=0) data = image_to_data(self.img, fmt='PNG', png_compression_level=0)
from PIL import Image from PIL import Image
i = Image.open(data) i = Image.open(BytesIO(data))
buf = BytesIO() buf = BytesIO()
i.save(buf, 'gif') i.save(buf, 'gif')
return buf.getvalue() return buf.getvalue()