mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
DOCX Output: Fix conversion failing if the input document has missing images. See #1926025 (Conversion from EPUB to PDF failed)
This commit is contained in:
parent
4a54f217df
commit
456e2e7e41
@ -51,9 +51,13 @@ class ImagesManager(object):
|
|||||||
def read_image(self, href):
|
def read_image(self, href):
|
||||||
if href not in self.images:
|
if href not in self.images:
|
||||||
item = self.oeb.manifest.hrefs.get(href) or self.oeb.manifest.hrefs.get(urlquote(href))
|
item = self.oeb.manifest.hrefs.get(href) or self.oeb.manifest.hrefs.get(urlquote(href))
|
||||||
|
try:
|
||||||
if item is None or not isinstance(item.data, bytes):
|
if item is None or not isinstance(item.data, bytes):
|
||||||
self.log.warning('Failed to find image:', href)
|
self.log.warning('Failed to find image:', href)
|
||||||
return
|
return
|
||||||
|
except FileNotFoundError:
|
||||||
|
self.log.warning('Failed to find image:', href)
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
fmt, width, height = identify(item.data)
|
fmt, width, height = identify(item.data)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user