mirror of
https://github.com/janeczku/calibre-web
synced 2024-11-28 12:30:00 +00:00
Merge remote-tracking branch 'comic/comic' into master
This commit is contained in:
commit
067f289050
14
cps/comic.py
14
cps/comic.py
@ -62,14 +62,12 @@ def _cover_processing(tmp_file_name, img, extension):
|
||||
im.save(tmp_bytesio, format='JPEG')
|
||||
img = tmp_bytesio.getvalue()
|
||||
|
||||
prefix = os.path.dirname(tmp_file_name)
|
||||
if img:
|
||||
tmp_cover_name = prefix + '/cover.jpg'
|
||||
image = open(tmp_cover_name, 'wb')
|
||||
image.write(img)
|
||||
image.close()
|
||||
else:
|
||||
tmp_cover_name = None
|
||||
if not img:
|
||||
return None
|
||||
|
||||
tmp_cover_name = os.path.join(os.path.dirname(tmp_file_name), 'cover.jpg')
|
||||
with open(tmp_cover_name, 'wb') as f:
|
||||
f.write(img)
|
||||
return tmp_cover_name
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user