mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-17 03:25:13 +01:00
Don't die if generating default masthead fails
This commit is contained in:
parent
5fb1d6ab82
commit
845e558ae0
1 changed files with 6 additions and 2 deletions
|
|
@ -770,7 +770,11 @@ def build_index(self):
|
|||
self.download_masthead(murl)
|
||||
if self.masthead_path is None:
|
||||
self.masthead_path = os.path.join(self.output_dir, 'mastheadImage.jpg')
|
||||
self.default_masthead_image(self.masthead_path)
|
||||
try:
|
||||
self.default_masthead_image(self.masthead_path)
|
||||
except:
|
||||
self.log.exception('Failed to generate default masthead image')
|
||||
self.masthead_path = None
|
||||
|
||||
if self.test:
|
||||
feeds = feeds[:2]
|
||||
|
|
@ -1061,7 +1065,7 @@ def create_opf(self, feeds, dir=None):
|
|||
opf = OPFCreator(dir, mi)
|
||||
# Add mastheadImage entry to <guide> section
|
||||
mp = getattr(self, 'masthead_path', None)
|
||||
if mp is not None:
|
||||
if mp is not None and os.access(mp, os.R_OK):
|
||||
from calibre.ebooks.metadata.opf2 import Guide
|
||||
ref = Guide.Reference(os.path.basename(self.masthead_path), os.getcwdu())
|
||||
ref.type = 'masthead'
|
||||
|
|
|
|||
Loading…
Reference in a new issue