Skip zero byte images when generating thumbnails

Signed-off-by: Björn Bidar <bjorn.bidar@thaodan.de>
This commit is contained in:
Björn Bidar 2023-10-15 06:33:30 +03:00
parent 296c07491c
commit 0bb54963df

View File

@ -271,6 +271,10 @@ class App(Gtk.Window):
self.image_names = []
for image_path in self.image_paths:
if os.path.getsize(image_path) == 0:
# Skip zero byte files inside the image_path
self.image_paths.remove(image_path)
continue
# If this image is not cached yet, resize and cache it:
cached_image_path = self.cachePath/os.path.basename(image_path)
if not cached_image_path.exists():