DOCX Input: Fix error when converting documents that have images pointing to web resources. Fixes #1659142 [DocX to ePub conversion fault (Error Code: 1)](https://bugs.launchpad.net/calibre/+bug/1659142)

This commit is contained in:
Kovid Goyal 2017-01-25 08:48:48 +05:30
parent 6cccd2efd3
commit 05b97d86e0

View File

@ -134,7 +134,10 @@ class Images(object):
with open(src, 'rb') as rawsrc:
raw = rawsrc.read()
else:
try:
raw = self.docx.read(fname)
except KeyError:
raise LinkedImageNotFound(fname)
base = base or image_filename(fname.rpartition('/')[-1]) or 'image'
ext = what(None, raw) or base.rpartition('.')[-1] or 'jpeg'
if ext == 'emf':