Properly identify huffman records in MOBI header

This commit is contained in:
Kovid Goyal 2014-03-29 12:59:37 +05:30
parent a814e8429e
commit a97a8a44a8
2 changed files with 4 additions and 5 deletions

View File

@ -427,8 +427,8 @@ class MOBIHeader(object): # {{{
r('First Image index', 'first_image_index')
r('Huffman record offset', 'huffman_record_offset')
a('Huffman record count: %d'%self.huffman_record_count)
r('DATP record offset', 'datp_record_offset')
a('DATP record count: %r'%self.datp_record_count)
r('Huffman table offset', 'datp_record_offset')
a('Huffman table length: %r'%self.datp_record_count)
a('EXTH flags: %s (%s)'%(bin(self.exth_flags)[2:], self.has_exth))
if self.has_drm_data:
a('Unknown3: %r'%self.unknown3)

View File

@ -116,9 +116,8 @@ class MOBIHeader(Header): # {{{
# 112: Huff/CDIC compression
huff_first_record
huff_count
# 120: Unknown (Maybe DATP related, maybe HUFF/CDIC related)
maybe_datp = zeroes(8)
huff_table_offset = zeroes(4)
huff_table_length = zeroes(4)
# 128: EXTH flags
exth_flags = DYN