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`.
|
#: convenience method, :method:`get_image_collection`.
|
||||||
is_image_collection = False
|
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
|
#: Options shared by all Input format plugins. Do not override
|
||||||
#: in sub-classes. Use :member:`options` instead. Every option must be an
|
#: in sub-classes. Use :member:`options` instead. Every option must be an
|
||||||
#: instance of :class:`OptionRecommendation`.
|
#: instance of :class:`OptionRecommendation`.
|
||||||
|
@ -53,7 +53,6 @@ class EPUBInput(InputFormatPlugin):
|
|||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def rationalize_cover(self, opf, log):
|
def rationalize_cover(self, opf, log):
|
||||||
guide_cover, guide_elem = None, None
|
guide_cover, guide_elem = None, None
|
||||||
for guide_elem in opf.iterguide():
|
for guide_elem in opf.iterguide():
|
||||||
@ -78,6 +77,7 @@ class EPUBInput(InputFormatPlugin):
|
|||||||
|
|
||||||
# Remove from spine as covers must be treated
|
# Remove from spine as covers must be treated
|
||||||
# specially
|
# specially
|
||||||
|
if not self.for_viewer:
|
||||||
spine[0].getparent().remove(spine[0])
|
spine[0].getparent().remove(spine[0])
|
||||||
guide_elem.set('href', 'calibre_raster_cover.jpg')
|
guide_elem.set('href', 'calibre_raster_cover.jpg')
|
||||||
from calibre.ebooks.oeb.base import OPF
|
from calibre.ebooks.oeb.base import OPF
|
||||||
|
@ -134,6 +134,7 @@ class EbookIterator(object):
|
|||||||
if hasattr(plumber.opts, 'no_process'):
|
if hasattr(plumber.opts, 'no_process'):
|
||||||
plumber.opts.no_process = True
|
plumber.opts.no_process = True
|
||||||
|
|
||||||
|
plumber.input_plugin.for_viewer = True
|
||||||
self.pathtoopf = plumber.input_plugin(open(plumber.input, 'rb'),
|
self.pathtoopf = plumber.input_plugin(open(plumber.input, 'rb'),
|
||||||
plumber.opts, plumber.input_fmt, self.log,
|
plumber.opts, plumber.input_fmt, self.log,
|
||||||
{}, self.base)
|
{}, self.base)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user