From 5d156e7d83e7dbe093340c654f4778cd94b89394 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 10 Oct 2008 12:56:07 -0700 Subject: [PATCH] Fix extraction of images from some MOBI files --- src/calibre/ebooks/mobi/reader.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/reader.py b/src/calibre/ebooks/mobi/reader.py index 15324dfbbc..f577650c54 100644 --- a/src/calibre/ebooks/mobi/reader.py +++ b/src/calibre/ebooks/mobi/reader.py @@ -391,7 +391,9 @@ class MobiReader(object): def fix_images(match): tag = match.group() - for pat in (r'\shirecindex=[\'"](\d+)[\'"]', '\srecindex=[\'"](\d+)[\'"]', '\slorecindex=[\'"](\d+)[\'"]'): + for pat in (r'\shirecindex=[\'"]{0,1}(\d+)[\'"]{0,1}', + '\srecindex=[\'"]{0,1}(\d+)[\'"]{0,1}', + '\slorecindex=[\'"]{0,1}(\d+)[\'"]{0,1}'): pat = re.compile(pat) m = pat.search(tag) if m: