ImageViewer: small optimization (#13807)
Some checks failed
macos / macOS 13 x86-64 🔨15.2 🎯10.15 (push) Has been cancelled
macos / macOS 14 ARM64 🔨15.4 🎯11.0 (push) Has been cancelled

Avoid decoding the first image twice (and decompressing it twice when used through ArchiveViewer).
This commit is contained in:
Benoit Pierre
2025-05-17 09:25:46 +02:00
committed by GitHub
parent 68a9a8d1ee
commit 8f71c00440

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()