mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ebook viewer: Display EPUB covers again
This commit is contained in:
parent
8670c28c36
commit
15324627dd
@ -109,6 +109,10 @@ class InputFormatPlugin(Plugin):
|
||||
#: convenience method, :method:`get_image_collection`.
|
||||
is_image_collection = False
|
||||
|
||||
#: If set to True, the input plugin will perform special processing
|
||||
#: to make its output suitable for viewing
|
||||
for_viewer = False
|
||||
|
||||
#: Options shared by all Input format plugins. Do not override
|
||||
#: in sub-classes. Use :member:`options` instead. Every option must be an
|
||||
#: instance of :class:`OptionRecommendation`.
|
||||
|
@ -53,7 +53,6 @@ class EPUBInput(InputFormatPlugin):
|
||||
traceback.print_exc()
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
def rationalize_cover(self, opf, log):
|
||||
guide_cover, guide_elem = None, None
|
||||
for guide_elem in opf.iterguide():
|
||||
@ -78,7 +77,8 @@ class EPUBInput(InputFormatPlugin):
|
||||
|
||||
# Remove from spine as covers must be treated
|
||||
# specially
|
||||
spine[0].getparent().remove(spine[0])
|
||||
if not self.for_viewer:
|
||||
spine[0].getparent().remove(spine[0])
|
||||
guide_elem.set('href', 'calibre_raster_cover.jpg')
|
||||
from calibre.ebooks.oeb.base import OPF
|
||||
t = etree.SubElement(elem[0].getparent(), OPF('item'),
|
||||
|
@ -134,6 +134,7 @@ class EbookIterator(object):
|
||||
if hasattr(plumber.opts, 'no_process'):
|
||||
plumber.opts.no_process = True
|
||||
|
||||
plumber.input_plugin.for_viewer = True
|
||||
self.pathtoopf = plumber.input_plugin(open(plumber.input, 'rb'),
|
||||
plumber.opts, plumber.input_fmt, self.log,
|
||||
{}, self.base)
|
||||
|
Loading…
x
Reference in New Issue
Block a user