mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 03:23:47 +02:00
...
This commit is contained in:
parent
61fddc54fb
commit
24afcc621e
1 changed files with 4 additions and 1 deletions
|
|
@ -366,8 +366,11 @@ def to_base(num, base=32):
|
|||
def mobify_image(data):
|
||||
'Convert PNG images to GIF as the idiotic Kindle cannot display some PNG'
|
||||
what = imghdr.what(None, data)
|
||||
|
||||
if what == 'png':
|
||||
data = save_cover_data_to(data, 'img.gif', return_data=True)
|
||||
im = Image()
|
||||
im.load(data)
|
||||
data = im.export('gif')
|
||||
return data
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue