mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
EPUB metadata: Fix extraction of cover image from EPUB 3 files that do not use EPUB 2 backward compatible markup and that have incorrect cover page markup as well. Fixes #1461321 [Private bug](https://bugs.launchpad.net/calibre/+bug/1461321)
This commit is contained in:
parent
f60a5367d1
commit
e522335424
@ -1176,6 +1176,12 @@ class OPF(object): # {{{
|
|||||||
mt = item.get('media-type', '')
|
mt = item.get('media-type', '')
|
||||||
if mt and mt.startswith('image/'):
|
if mt and mt.startswith('image/'):
|
||||||
return item.get('href', None)
|
return item.get('href', None)
|
||||||
|
elif self.package_version >= 3.0:
|
||||||
|
for item in self.itermanifest():
|
||||||
|
if item.get('properties') == 'cover-image':
|
||||||
|
mt = item.get('media-type', '')
|
||||||
|
if mt and 'xml' not in mt and 'html' not in mt:
|
||||||
|
return item.get('href', None)
|
||||||
|
|
||||||
@dynamic_property
|
@dynamic_property
|
||||||
def cover(self):
|
def cover(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user