From d149634ad46cad89ffbdf77465ea928ace38d1c7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 12 May 2016 22:18:40 +0530 Subject: [PATCH] Fix exporting in GIF format in the legacy IM portability layer --- src/calibre/utils/magick/legacy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/utils/magick/legacy.py b/src/calibre/utils/magick/legacy.py index 9bec88389b..a84491d7fe 100644 --- a/src/calibre/utils/magick/legacy.py +++ b/src/calibre/utils/magick/legacy.py @@ -141,7 +141,7 @@ class Image(object): if fmt.lower() == 'gif': data = image_to_data(self.img, fmt='PNG', png_compression_level=0) from PIL import Image - i = Image.open(data) + i = Image.open(BytesIO(data)) buf = BytesIO() i.save(buf, 'gif') return buf.getvalue()