mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
CoverBrowser: speedup "View full size cover"
It was doing a full document load to get the cover. It now does the faster "only metadata" load. Also move the trick of setting a default font in CreDocument, so that all callers of document:loadDocument(false) benefit from it. Prevent crash when no cover image is available (even if the cache says it has one, the file may have been updated and doesn't have it anymore).
This commit is contained in:
@@ -177,6 +177,11 @@ function CreDocument:loadDocument(full_document)
|
||||
if not self._loaded then
|
||||
local only_metadata = full_document == false
|
||||
logger.dbg("CreDocument: loading document...")
|
||||
if only_metadata then
|
||||
-- Setting a default font before loading document
|
||||
-- actually do prevent some crashes
|
||||
self:setFontFace(self.default_font)
|
||||
end
|
||||
if self._document:loadDocument(self.file, only_metadata) then
|
||||
self._loaded = true
|
||||
logger.dbg("CreDocument: loading done.")
|
||||
|
||||
Reference in New Issue
Block a user