mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04: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
@ -216,7 +216,11 @@ class PDFWriter(QObject):
|
||||
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…
x
Reference in New Issue
Block a user