diff --git a/app/logic/image_processing.py b/app/logic/image_processing.py index ab15edd..f0c2819 100644 --- a/app/logic/image_processing.py +++ b/app/logic/image_processing.py @@ -194,7 +194,9 @@ class ImageProcessingMixin: return width, height = self.orig_img.size max_w, max_h = PREVIEW_MAX_SIZE - scale = min(max_w / width, max_h / height, 1.0) + scale = min(max_w / width, max_h / height) + if scale <= 0: + scale = 1.0 size = (max(1, int(width * scale)), max(1, int(height * scale))) self.preview_img = self.orig_img.resize(size, Image.LANCZOS) self.preview_tk = ImageTk.PhotoImage(self.preview_img)