blitbuffer: fixups for base (#6714)

fixups for base bumped to https://github.com/koreader/koreader-base/pull/1201
otherwise tilecache breaks
pull/6680/head
ezdiy 4 years ago committed by GitHub
parent 6bfa021689
commit 7a40b496fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1 +1 @@
Subproject commit de01c8a37cf6c938a57cd16fdc0796239ece0244
Subproject commit df85f11880b7469020bafe525bc74ec1536db6cb

@ -15,15 +15,15 @@ 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.pitch, self.bb:getType(),
self.bb.w, self.bb.h, self.bb.stride, self.bb:getType(),
Blitbuffer.tostring(self.bb), filename)
end
function TileCacheItem:load(filename)
local w, h, pitch, bb_type, bb_data
local w, h, stride, bb_type, bb_data
self.size, self.excerpt, self.pageno,
w, h, pitch, bb_type, bb_data = serial.load(filename)
self.bb = Blitbuffer.fromstring(w, h, bb_type, bb_data, pitch)
w, h, stride, bb_type, bb_data = serial.load(filename)
self.bb = Blitbuffer.fromstring(w, h, bb_type, bb_data, stride)
logger.dbg("loading tile cache from", filename, self)
end

@ -169,7 +169,7 @@ function ImageWidget:_loadfile()
-- cache this image
logger.dbg("cache", hash)
cache = ImageCacheItem:new{ bb = self._bb }
cache.size = cache.bb.pitch * cache.bb.h * cache.bb:getBytesPerPixel()
cache.size = 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.pitch
dbrow.cover_bpitch = 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()

Loading…
Cancel
Save