From 58abe77cbcbfa73f041309e66b61abf39d17d41e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 29 Mar 2025 16:39:31 +0530 Subject: [PATCH] Fix #2105373 [I get this message if I try to crop a Cover picture manually:](https://bugs.launchpad.net/calibre/+bug/2105373) --- src/calibre/gui2/dialogs/trim_image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/dialogs/trim_image.py b/src/calibre/gui2/dialogs/trim_image.py index 614e94bd3b..bc0216dc0d 100644 --- a/src/calibre/gui2/dialogs/trim_image.py +++ b/src/calibre/gui2/dialogs/trim_image.py @@ -185,7 +185,7 @@ class TrimImage(QDialog): if rect: x, y, w, h = map(int, self.canvas.rect_for_trim()) text = f'{int(w)}x{int(h)}' - text = _('Size: {0}px Aspect ratio: {1:.3g}').format(text, w / h) + text = _('Size: {0}px Aspect ratio: {1:.3g}').format(text, (w / h) if h else 0) else: text = '' self.tr_sz.setText(text)