From 35a121280b9a90b4db319646625993d034b14c84 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 11 Jun 2009 12:20:17 -0700 Subject: [PATCH] MOBI Output: Change encoding drirection of vwi in indexing trailing bytes --- src/calibre/ebooks/mobi/writer.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/calibre/ebooks/mobi/writer.py b/src/calibre/ebooks/mobi/writer.py index d3b494af1d..8e9fc25ebf 100644 --- a/src/calibre/ebooks/mobi/writer.py +++ b/src/calibre/ebooks/mobi/writer.py @@ -491,12 +491,12 @@ class MobiWriter(object): else : tbsType = 6 - tbSequence = decint(tbsType, DECINT_BACKWARD) - tbSequence += decint(0x00, DECINT_BACKWARD) + tbSequence = decint(tbsType, DECINT_FORWARD) + tbSequence += decint(0x00, DECINT_FORWARD) # Don't write a nodecount for opening type 2 record if tbsType != 2 : tbSequence += chr(self._HTMLRecords[nrecords].currentSectionNodeCount) - tbSequence += decint(len(tbSequence) + 1, DECINT_BACKWARD) + tbSequence += decint(len(tbSequence) + 1, DECINT_FORWARD) else : # Determine tbsType for HTMLRecords > 0 @@ -520,12 +520,12 @@ class MobiWriter(object): shiftedNCXEntry |= tbsType # Assemble the TBS - tbSequence = decint(shiftedNCXEntry, DECINT_BACKWARD) - tbSequence += decint(0x00, DECINT_BACKWARD) + tbSequence = decint(shiftedNCXEntry, DECINT_FORWARD) + tbSequence += decint(0x00, DECINT_FORWARD) # Don't write a nodecount for terminating type 2 record if tbsType != 2 : tbSequence += chr(self._HTMLRecords[nrecords].currentSectionNodeCount) - tbSequence += decint(len(tbSequence) + 1, DECINT_BACKWARD) + tbSequence += decint(len(tbSequence) + 1, DECINT_FORWARD) # print "record %d: tbsType %d" % (nrecords, tbsType) self._tbSequence = tbSequence