mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-03-03 16:07:36 +01:00
RB Output: Fix calibre generated rb files not being opened by the RocketBook. Fixes #880930 (Fix rb format compression)
This commit is contained in:
commit
8258bbfefb
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