mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-06 22:34:27 +01:00
Fix a regression in calibre 5 that broke processing of some PDB files with images. Fixes #1901957 [E-book viewer: can't open a .pdb file](https://bugs.launchpad.net/calibre/+bug/1901957)
This commit is contained in:
parent
35df1312a2
commit
b7bb73e40e
1 changed files with 3 additions and 2 deletions
|
|
@ -13,9 +13,9 @@
|
|||
|
||||
from calibre import CurrentDir
|
||||
from calibre.ebooks.metadata.opf2 import OPFCreator
|
||||
from calibre.ebooks.pdb.formatreader import FormatReader
|
||||
from calibre.ebooks.pdb.ereader import EreaderError
|
||||
from polyglot.builtins import unicode_type, range
|
||||
from calibre.ebooks.pdb.formatreader import FormatReader
|
||||
from polyglot.builtins import as_unicode, range, unicode_type
|
||||
|
||||
|
||||
class HeaderRecord(object):
|
||||
|
|
@ -116,6 +116,7 @@ def extract_content(self, output_dir):
|
|||
for i in range(self.header_record.non_text_offset, len(self.sections)):
|
||||
name, img = self.get_image(i)
|
||||
if name:
|
||||
name = as_unicode(name)
|
||||
images.append(name)
|
||||
with open(name, 'wb') as imgf:
|
||||
self.log.debug('Writing image %s to images/' % name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue