mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-22 13:33:23 +02:00
Fix bug #880930: Fix rb format compression.
This commit is contained in:
parent
88e9a7b626
commit
2baaf35924
1 changed files with 3 additions and 2 deletions
|
|
@ -104,8 +104,9 @@ def _text(self, oeb_book):
|
|||
size = len(text)
|
||||
|
||||
pages = []
|
||||
for i in range(0, (len(text) / TEXT_RECORD_SIZE) + 1):
|
||||
pages.append(zlib.compress(text[i * TEXT_RECORD_SIZE : (i * TEXT_RECORD_SIZE) + TEXT_RECORD_SIZE], 9))
|
||||
for i in range(0, (len(text) + TEXT_RECORD_SIZE-1) / TEXT_RECORD_SIZE):
|
||||
zobj = zlib.compressobj(9, zlib.DEFLATED, 13, 8, 0)
|
||||
pages.append(zobj.compress(text[i * TEXT_RECORD_SIZE : (i * TEXT_RECORD_SIZE) + TEXT_RECORD_SIZE]) + zobj.flush())
|
||||
|
||||
return (size, pages)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue