From 6f0c724dad20323b512b2d85aae413783c0808e1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 9 Aug 2017 10:07:42 +0530 Subject: [PATCH] Conversion: Fix remove first image option not working for comic input with the disable comic processing option. Fixes #1709150 [CBZ > EPUB "remove first image" issue](https://bugs.launchpad.net/calibre/+bug/1709150) --- src/calibre/ebooks/oeb/transforms/jacket.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/oeb/transforms/jacket.py b/src/calibre/ebooks/oeb/transforms/jacket.py index a29af2d7e9..3c6ba2621f 100644 --- a/src/calibre/ebooks/oeb/transforms/jacket.py +++ b/src/calibre/ebooks/oeb/transforms/jacket.py @@ -15,7 +15,7 @@ from lxml import etree from calibre import guess_type, strftime from calibre.constants import iswindows from calibre.ebooks.BeautifulSoup import BeautifulSoup -from calibre.ebooks.oeb.base import XPath, XHTML_NS, XHTML, xml2text, urldefrag +from calibre.ebooks.oeb.base import XPath, XHTML_NS, XHTML, xml2text, urldefrag, urlnormalize from calibre.library.comments import comments_to_html from calibre.utils.date import is_date_undefined, as_local_time from calibre.utils.icu import sort_key @@ -43,7 +43,10 @@ class Base(object): if removed >= limit: break href = item.abshref(img.get('src')) - image = self.oeb.manifest.hrefs.get(href, None) + image = self.oeb.manifest.hrefs.get(href) + if image is None: + href = urlnormalize(href) + image = self.oeb.manifest.hrefs.get(href) if image is not None: self.oeb.manifest.remove(image) self.oeb.guide.remove_by_href(href)