ImageViewer: small optimization (#13807)

Avoid decoding the first image twice (and decompressing it twice when used through ArchiveViewer).
This commit is contained in:
Benoit Pierre authored and GitHub committed 2025-05-17 09:25:46 +02:00
1 parent 68a9a8d1ee
commit 8f71c00440
1 file changed
+3
+3
View File
@@ -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()