1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
From: Stuart Prescott <stuart@debian.org>
Date: Tue, 12 Nov 2024 13:37:07 +1100
Subject: Fix image comparator in test suite
- specify sizes for intermediate images being compared
---
unittests/helpers/utils.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/unittests/helpers/utils.py b/unittests/helpers/utils.py
index c063770..e37ddd8 100644
--- a/unittests/helpers/utils.py
+++ b/unittests/helpers/utils.py
@@ -10,7 +10,7 @@ CACHE_LOCATION = Path(__file__).absolute().parent / "compare_cache"
def cmp_img(a: str, b: str) -> float:
out = subprocess.run(["compare", "-quiet", "-metric", "MSE",
- '-subimage-search', a, b, "NULL:"],
+ '-subimage-search', '-resize', '200x200', a, b, "NULL:"],
stderr=subprocess.PIPE, stdin=subprocess.DEVNULL, check=False)
# return code 1 is for dissimilar images, but we use our own threshold
@@ -20,7 +20,7 @@ def cmp_img(a: str, b: str) -> float:
def __init__(self, message):
self.message = message
out = subprocess.run(["compare", "-verbose", "-metric", "MSE",
- '-subimage-search', a, b, "NULL:"],
+ '-subimage-search', '-resize', '200x200', a, b, "NULL:"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.DEVNULL,
check=False)
print(out.stdout.decode())
|