From 2eb5af2f8c26388d13905197c820571b8b318952 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 9 Mar 2021 21:06:23 +0530 Subject: [PATCH] Also show aspect ratio of trim region --- src/calibre/gui2/dialogs/trim_image.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/dialogs/trim_image.py b/src/calibre/gui2/dialogs/trim_image.py index fd36e70636..ac60adac18 100644 --- a/src/calibre/gui2/dialogs/trim_image.py +++ b/src/calibre/gui2/dialogs/trim_image.py @@ -84,9 +84,10 @@ class TrimImage(QDialog): def selection_area_changed(self, rect): if rect: - w = int(rect.width()) - h = int(rect.height()) - text = f'{w}x{h}' + w = rect.width() + h = rect.height() + text = f'{int(w)}x{int(h)}' + text = _('Size: {0} Aspect ratio: {1:.2g}').format(text, w / h) else: text = '' self.tr_sz.setText(text)