mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Fix exporting in GIF format in the legacy IM portability layer
This commit is contained in:
parent
88ff4ae126
commit
d149634ad4
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user