mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54: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))
|
fmt, width, height = identify(bytes(raw))
|
||||||
except Exception:
|
except Exception:
|
||||||
continue
|
continue
|
||||||
|
if width < 0 or height < 0:
|
||||||
|
continue
|
||||||
if 0.8 <= height/width <= 1.8 and height*width >= 160000:
|
if 0.8 <= height/width <= 1.8 and height*width >= 160000:
|
||||||
return (fmt, raw)
|
return (fmt, raw)
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ def read_cover(stream, zin, mi, opfmeta, extract_cover):
|
|||||||
if not cover_data:
|
if not cover_data:
|
||||||
raw = zin.read(cover_href)
|
raw = zin.read(cover_href)
|
||||||
try:
|
try:
|
||||||
fmt, width, height = identify(bytes(raw))
|
fmt = identify(bytes(raw))[0]
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user