Commit 067f2890 authored by Ozzieisaacs's avatar Ozzieisaacs

Merge remote-tracking branch 'comic/comic' into master

parents 06511b92 95a1a71a
...@@ -62,14 +62,12 @@ def _cover_processing(tmp_file_name, img, extension): ...@@ -62,14 +62,12 @@ def _cover_processing(tmp_file_name, img, extension):
im.save(tmp_bytesio, format='JPEG') im.save(tmp_bytesio, format='JPEG')
img = tmp_bytesio.getvalue() img = tmp_bytesio.getvalue()
prefix = os.path.dirname(tmp_file_name) if not img:
if img: return None
tmp_cover_name = prefix + '/cover.jpg'
image = open(tmp_cover_name, 'wb') tmp_cover_name = os.path.join(os.path.dirname(tmp_file_name), 'cover.jpg')
image.write(img) with open(tmp_cover_name, 'wb') as f:
image.close() f.write(img)
else:
tmp_cover_name = None
return tmp_cover_name return tmp_cover_name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment