mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 04:23:41 +02:00
PDF Output: Do not error out when cover generation fails
PDF Output: Do not abort conversion if the document being converted has an HTML cover (found in some broken EPUB files).
This commit is contained in:
parent
b5c70f1b9b
commit
a58b15a0ad
1 changed files with 5 additions and 1 deletions
|
|
@ -216,7 +216,11 @@ def dump(self, items, out_stream, pdf_metadata):
|
|||
try:
|
||||
if self.cover_data is not None:
|
||||
p = QPixmap()
|
||||
p.loadFromData(self.cover_data)
|
||||
try:
|
||||
p.loadFromData(self.cover_data)
|
||||
except TypeError:
|
||||
self.log.warn('This ebook does not have a raster cover, cannot generate cover for PDF'
|
||||
'. Cover type: %s' % type(self.cover_data))
|
||||
if not p.isNull():
|
||||
self.doc.init_page()
|
||||
draw_image_page(QRect(*self.doc.full_page_rect),
|
||||
|
|
|
|||
Loading…
Reference in a new issue