diff --git a/tools/tui/graphics/collection.go b/tools/tui/graphics/collection.go index 4fa41b0c6..2a54cc269 100644 --- a/tools/tui/graphics/collection.go +++ b/tools/tui/graphics/collection.go @@ -138,7 +138,9 @@ func (self *ImageCollection) ResizeForPageSize(width, height int) { ctx.Parallel(0, len(keys), func(nums <-chan int) { for i := range nums { img := self.images[keys[i]] - img.ResizeForPageSize(width, height) + if img.src.loaded && img.err == nil { + img.ResizeForPageSize(width, height) + } } }) } @@ -298,6 +300,7 @@ func (self *ImageCollection) LoadAll() { if img.err == nil { img.src.size.Width, img.src.size.Height = img.src.data.Width, img.src.data.Height } + img.src.loaded = true } } })