From bfdb4cf1089b7b08cd0f84640ea869c5ee9bd5d4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 12 Nov 2010 09:40:38 -0700 Subject: [PATCH] Fix #7455 (Converting Mobipocket PRC to ePUB - missing pictures) --- src/calibre/ebooks/mobi/reader.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/ebooks/mobi/reader.py b/src/calibre/ebooks/mobi/reader.py index f0ccc93c9c..c55b94cac5 100644 --- a/src/calibre/ebooks/mobi/reader.py +++ b/src/calibre/ebooks/mobi/reader.py @@ -569,6 +569,10 @@ class MobiReader(object): for attr in self.IMAGE_ATTRS: recindex = attrib.pop(attr, None) or recindex if recindex is not None: + try: + recindex = '%05d'%int(recindex) + except: + pass attrib['src'] = 'images/%s.jpg' % recindex for attr in ('width', 'height'): if attr in attrib: