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:
Kovid Goyal 2015-06-03 22:10:10 +05:30
parent f60a5367d1
commit e522335424

View File

@ -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):