From 53809e3b3ff5e5012d4797634f913d6dddc74d24 Mon Sep 17 00:00:00 2001 From: Michael Stevenson Date: Mon, 28 Nov 2022 09:37:08 -0800 Subject: [PATCH] Fix index out of range when deleting the final image --- scripts/image_caption_gui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/image_caption_gui.py b/scripts/image_caption_gui.py index 8ed7334..f416610 100644 --- a/scripts/image_caption_gui.py +++ b/scripts/image_caption_gui.py @@ -106,8 +106,8 @@ class ImageView(tk.Frame): caption_path = img.caption_path() if caption_path.exists(): caption_path.rename(trash_path / caption_path.name) - del self.images[self.index] + self.set_index(self.index) self.update_ui() def update_ui(self):