mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
ImageViewer: small optimization (#13807)
Avoid decoding the first image twice (and decompressing it twice when used through ArchiveViewer).
This commit is contained in:
@@ -466,6 +466,9 @@ function ImageViewer:onShow()
|
||||
end
|
||||
|
||||
function ImageViewer:switchToImageNum(image_num)
|
||||
if image_num == self._images_list_cur then
|
||||
return
|
||||
end
|
||||
if self.image and self.image_disposable and self.image.free then
|
||||
logger.dbg("ImageViewer:switchToImageNum: free self.image", self.image)
|
||||
self.image:free()
|
||||
|
||||
Reference in New Issue
Block a user