From 2cdb738d905b5cf01b6b6c7d2469dccfc1a379e1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 11 Sep 2024 12:01:58 +0530 Subject: [PATCH] ... --- src/calibre/gui2/image_popup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/image_popup.py b/src/calibre/gui2/image_popup.py index 161dfa0890..95bcda9a82 100644 --- a/src/calibre/gui2/image_popup.py +++ b/src/calibre/gui2/image_popup.py @@ -224,7 +224,9 @@ class ImageView(QDialog): def factor_from_fit(self): scaled_height = self.label.size().height() actual_height = self.current_img.size().height() - return scaled_height / actual_height + if actual_height: + return scaled_height / actual_height + return 1 def zoom_requested(self, zoom_out): if (zoom_out and self.zo_button.isEnabled()) or (not zoom_out and self.zi_button.isEnabled()):