ImageViewer: small optimization (#13807)
Avoid decoding the first image twice (and decompressing it twice when used through ArchiveViewer).
This commit is contained in:
1 parent
68a9a8d1ee
commit
8f71c00440
1 file changed
+3
@@ -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