mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
...
This commit is contained in:
parent
0ae69c8f96
commit
6f48fe28e2
@ -29,6 +29,8 @@ def get_cover(docx):
|
||||
fmt, width, height = identify(bytes(raw))
|
||||
except Exception:
|
||||
continue
|
||||
if width < 0 or height < 0:
|
||||
continue
|
||||
if 0.8 <= height/width <= 1.8 and height*width >= 160000:
|
||||
return (fmt, raw)
|
||||
|
||||
|
@ -259,7 +259,7 @@ def read_cover(stream, zin, mi, opfmeta, extract_cover):
|
||||
if not cover_data:
|
||||
raw = zin.read(cover_href)
|
||||
try:
|
||||
fmt, width, height = identify(bytes(raw))
|
||||
fmt = identify(bytes(raw))[0]
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user