From e586ce4f41922210b6c5189871ffa417b2035204 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 20 Dec 2013 14:24:52 +0530 Subject: [PATCH] DOCX Input: Fix error when converting DOCX file that contains only image based links and no text based links. Fixes #1263021 [Book failed to convert docx to ePub](https://bugs.launchpad.net/calibre/+bug/1263021) --- src/calibre/ebooks/docx/images.py | 2 +- src/calibre/ebooks/docx/to_html.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/docx/images.py b/src/calibre/ebooks/docx/images.py index bda3eb0d32..962bebb0af 100644 --- a/src/calibre/ebooks/docx/images.py +++ b/src/calibre/ebooks/docx/images.py @@ -184,7 +184,7 @@ class Images(object): img = IMG(src='images/%s' % src) img.set('alt', alt or 'Image') if link is not None: - self.links.append((img, link)) + self.links.append((img, link, self.rid_map)) return img def drawing_to_html(self, drawing, page): diff --git a/src/calibre/ebooks/docx/to_html.py b/src/calibre/ebooks/docx/to_html.py index a7afb5445a..01bb915dcb 100644 --- a/src/calibre/ebooks/docx/to_html.py +++ b/src/calibre/ebooks/docx/to_html.py @@ -516,7 +516,7 @@ class Convert(object): continue span.set('href', url) - for img, link in self.images.links: + for img, link, relationships_by_id in self.images.links: parent = img.getparent() idx = parent.index(img) a = A(img)