mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-21 14:05:47 +02:00
EPUB Input: Ignore guide element marking the first spine item as a cover if the spine contains only a single item
This commit is contained in:
parent
2d76655ddc
commit
f49cbe2489
1 changed files with 9 additions and 2 deletions
|
|
@ -105,8 +105,15 @@ def rationalize_cover(self, opf, log):
|
|||
# Remove from spine as covers must be treated
|
||||
# specially
|
||||
if not self.for_viewer:
|
||||
spine[0].getparent().remove(spine[0])
|
||||
removed = guide_cover
|
||||
if len(spine) == 1:
|
||||
log.warn('There is only a single spine item and it is marked as the cover. Removing cover marking.')
|
||||
for guide_elem in tuple(opf.iterguide()):
|
||||
if guide_elem.get('type', '').lower() == 'cover':
|
||||
guide_elem.getparent().remove(guide_elem)
|
||||
return
|
||||
else:
|
||||
spine[0].getparent().remove(spine[0])
|
||||
removed = guide_cover
|
||||
else:
|
||||
# Ensure the cover is displayed as the first item in the book, some
|
||||
# epub files have it set with linear='no' which causes the cover to
|
||||
|
|
|
|||
Loading…
Reference in a new issue