diff --git a/src/calibre/ebooks/conversion/plugins/epub_input.py b/src/calibre/ebooks/conversion/plugins/epub_input.py index 11499e75cc..642235e595 100644 --- a/src/calibre/ebooks/conversion/plugins/epub_input.py +++ b/src/calibre/ebooks/conversion/plugins/epub_input.py @@ -103,6 +103,12 @@ class EPUBInput(InputFormatPlugin): 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'),