mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-01 05:43:05 +02:00
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)
This commit is contained in:
parent
20a01d93df
commit
6f0c724dad
1 changed files with 5 additions and 2 deletions
|
|
@ -15,7 +15,7 @@
|
|||
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 @@ def remove_images(self, item, limit=1):
|
|||
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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue