mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 10:54:53 +02:00
Fix cover detection in FB2.1 fb2 files
This commit is contained in:
parent
610f2e32cb
commit
2c9ca9ea7e
1 changed files with 4 additions and 4 deletions
|
|
@ -9,8 +9,8 @@
|
|||
from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation
|
||||
from calibre import guess_type
|
||||
|
||||
FB2NS = 'http://www.gribuser.ru/xml/fictionbook/2.0'
|
||||
|
||||
FB2NS = 'http://www.gribuser.ru/xml/fictionbook/2.0'
|
||||
FB21NS = 'http://www.gribuser.ru/xml/fictionbook/2.1'
|
||||
|
||||
class FB2Input(InputFormatPlugin):
|
||||
|
||||
|
|
@ -40,7 +40,6 @@ def convert(self, stream, options, file_ext, log,
|
|||
from calibre.ebooks.metadata.meta import get_metadata
|
||||
from calibre.ebooks.oeb.base import XLINK_NS, XHTML_NS, RECOVER_PARSER
|
||||
from calibre.ebooks.chardet import xml_to_unicode
|
||||
NAMESPACES = {'f':FB2NS, 'l':XLINK_NS}
|
||||
self.log = log
|
||||
log.debug('Parsing XML...')
|
||||
raw = stream.read().replace('\0', '')
|
||||
|
|
@ -61,7 +60,8 @@ def convert(self, stream, options, file_ext, log,
|
|||
try:
|
||||
fb_ns = doc.nsmap[doc.prefix]
|
||||
except Exception:
|
||||
fb_ns = 'http://www.gribuser.ru/xml/fictionbook/2.0'
|
||||
fb_ns = FB2NS
|
||||
NAMESPACES = {'f':fb_ns, 'l':XLINK_NS}
|
||||
stylesheets = doc.xpath('//*[local-name() = "stylesheet" and @type="text/css"]')
|
||||
css = ''
|
||||
for s in stylesheets:
|
||||
|
|
|
|||
Loading…
Reference in a new issue