mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Handle the BlitBuffer struct changes
* stride is now a size_t On some platforms, that's 64 bits, which means it's no longer automatically converted to a Lua number to avoid precision loss. Do that ourselves, because lua-serialize doesn't know how to handle an uint64_t cdata ;).
This commit is contained in:
@@ -15,7 +15,7 @@ end
|
||||
function TileCacheItem:dump(filename)
|
||||
logger.dbg("dumping tile cache to", filename, self.excerpt)
|
||||
return serial.dump(self.size, self.excerpt, self.pageno,
|
||||
self.bb.w, self.bb.h, self.bb.stride, self.bb:getType(),
|
||||
self.bb.w, self.bb.h, tonumber(self.bb.stride), self.bb:getType(),
|
||||
Blitbuffer.tostring(self.bb), filename)
|
||||
end
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ function ImageWidget:_loadfile()
|
||||
-- cache this image
|
||||
logger.dbg("cache", hash)
|
||||
cache = ImageCacheItem:new{ bb = self._bb }
|
||||
cache.size = cache.bb.stride * cache.bb.h
|
||||
cache.size = tonumber(cache.bb.stride) * cache.bb.h
|
||||
ImageCache:insert(hash, cache)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -450,7 +450,7 @@ function BookInfoManager:extractBookInfo(filepath, cover_specs)
|
||||
dbrow.cover_w = cbb_w
|
||||
dbrow.cover_h = cbb_h
|
||||
dbrow.cover_btype = cover_bb:getType()
|
||||
dbrow.cover_bpitch = cover_bb.stride
|
||||
dbrow.cover_bpitch = tonumber(cover_bb.stride)
|
||||
local cover_data = Blitbuffer.tostring(cover_bb)
|
||||
cover_bb:free() -- free bb before compressing to save memory
|
||||
dbrow.cover_datalen = cover_data:len()
|
||||
|
||||
Reference in New Issue
Block a user