mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 06:33:08 +02:00
KF8 Input: Fix conversion/vieweing of KF8 files generated with the unreleased? kindlegen 2.7. Fixes #1067310 (Private bug)
This commit is contained in:
parent
62c80eb670
commit
6915b2fae9
1 changed files with 3 additions and 6 deletions
|
|
@ -172,12 +172,9 @@ def __init__(self, raw, ident, user_encoding, log, try_extra_data_fix=False):
|
|||
self.codec = 'cp1252' if not user_encoding else user_encoding
|
||||
log.warn('Unknown codepage %d. Assuming %s' % (self.codepage,
|
||||
self.codec))
|
||||
# There exists some broken DRM removal tool that removes DRM but
|
||||
# leaves the DRM fields in the header yielding a header size of
|
||||
# 0xF8. The actual value of max_header_length should be 0xE8 but
|
||||
# it's changed to accommodate this silly tool. Hopefully that will
|
||||
# not break anything else.
|
||||
max_header_length = 0xF8
|
||||
# Some KF8 files have header length == 256. See
|
||||
# https://bugs.launchpad.net/bugs/1067310
|
||||
max_header_length = 0x100
|
||||
|
||||
if (ident == 'TEXTREAD' or self.length < 0xE4 or
|
||||
self.length > max_header_length or
|
||||
|
|
|
|||
Loading…
Reference in a new issue