mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04: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
@ -104,8 +104,9 @@ class RBWriter(object):
|
||||
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…
x
Reference in New Issue
Block a user