mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-04-21 05:31:30 +02:00
Enable mobi write support.
This commit is contained in:
@@ -46,8 +46,14 @@ class Resources(object):
|
||||
try:
|
||||
return func(data)
|
||||
except Exception:
|
||||
if 'png' != what(None, data):
|
||||
ext = what(None, data)
|
||||
if ext not in ('png', 'gif'):
|
||||
raise
|
||||
if ext == 'gif':
|
||||
with PersistentTemporaryFile(suffix='.gif') as pt:
|
||||
pt.write(data)
|
||||
return mobify_image(data)
|
||||
|
||||
with PersistentTemporaryFile(suffix='.png') as pt:
|
||||
pt.write(data)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user