From 672bd555f4dabebd60f93d7854f8704af0478d6c Mon Sep 17 00:00:00 2001 From: Luis Quesada Date: Tue, 11 Jun 2024 05:28:22 +0200 Subject: [PATCH] Add assert on min_width vs max_width and min_height vs max_height --- inpaint_cropandstitch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/inpaint_cropandstitch.py b/inpaint_cropandstitch.py index 8c56e71..65cc173 100644 --- a/inpaint_cropandstitch.py +++ b/inpaint_cropandstitch.py @@ -342,6 +342,8 @@ class InpaintCrop: min_height = max_height = force_height if mode == 'ranged size' or mode == 'forced size': + assert max_width >= min_width, "max_width must be greater than or equal to min_width" + assert max_height >= min_height, "max_height must be greater than or equal to min_height" # Ensure we set an aspect ratio supported by min_width, max_width, min_height, max_height current_width = x_max - x_min + 1 current_height = y_max - y_min + 1