MOBI Input: Add support for MOBI/KF8 files generated with the to be released kindlegen 2.9. Fixes #1179144 (error during conversion azw3 to other formats)

This commit is contained in:
Kovid Goyal 2013-05-12 15:38:23 +05:30
parent c1d49333a0
commit 689808861a

View File

@ -181,9 +181,9 @@ class BookHeader(object):
self.codec = 'cp1252' if not user_encoding else user_encoding
log.warn('Unknown codepage %d. Assuming %s' % (self.codepage,
self.codec))
# Some KF8 files have header length == 256 (generated by kindlegen
# 2.7?). See https://bugs.launchpad.net/bugs/1067310
max_header_length = 0x100
# Some KF8 files have header length == 264 (generated by kindlegen
# 2.9?). See https://bugs.launchpad.net/bugs/1179144
max_header_length = 0x108
if (ident == 'TEXTREAD' or self.length < 0xE4 or
self.length > max_header_length or