mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-04-14 13:11:56 -04: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
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user