mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-22 00:53:21 +02:00
E-book viewer: When viewing epub files that have their cover marked as non-linear, show the cover at the start of the book instead of the end. Fixes #1126030 (Epub file: import ziped and cover position)
This commit is contained in:
parent
68007f2c7f
commit
173a3cbd9c
1 changed files with 6 additions and 0 deletions
|
|
@ -103,6 +103,12 @@ def rationalize_cover(self, opf, log):
|
|||
if not self.for_viewer:
|
||||
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 liner='no' which causes the cover to
|
||||
# display in the end
|
||||
spine[0].attrib.pop('linear', None)
|
||||
opf.spine[0].is_linear = True
|
||||
guide_elem.set('href', 'calibre_raster_cover.jpg')
|
||||
from calibre.ebooks.oeb.base import OPF
|
||||
t = etree.SubElement(elem[0].getparent(), OPF('item'),
|
||||
|
|
|
|||
Loading…
Reference in a new issue