From ccc04983cfd96f9cdf6b85e455783f77b34b399c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nimish=20G=C3=A5tam?= Date: Sat, 1 Feb 2025 12:38:37 +0100 Subject: [PATCH] Update ui.py removed unnecessary code as per AI code review (which is a thing now because of course it is) --- modules/ui.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/modules/ui.py b/modules/ui.py index 5e5dff6..1d7c2be 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -701,12 +701,6 @@ def fit_image_to_size(image, width: int, height: int): h, w, _ = image.shape ratio_h = 0.0 ratio_w = 0.0 - if width > height: - ratio_h = height / h - else: - ratio_w = width / w - ratio = max(ratio_w, ratio_h) - new_size = (int(ratio * w), int(ratio * h)) ratio_w = width / w ratio_h = height / h # Use the smaller ratio to ensure the image fits within the given dimensions