From 8b0b9ed5fe1f4f5fed31226563a2b15553f728c6 Mon Sep 17 00:00:00 2001 From: Hermann Kraus Date: Thu, 8 Mar 2012 18:29:46 +0100 Subject: [PATCH] Handle different image sizes correctly. --- tests/visual_tests/compare.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/visual_tests/compare.py b/tests/visual_tests/compare.py index 21a627d99..414f49979 100644 --- a/tests/visual_tests/compare.py +++ b/tests/visual_tests/compare.py @@ -1,4 +1,4 @@ -import math, operator +#import math, operator import Image import sys @@ -27,6 +27,10 @@ def compare(fn1, fn2): return -1 diff = 0 pixels = im1.size[0] * im1.size[1] + delta_pixels = im2.size[0] * im2.size[1] - pixels + if delta_pixels != 0: + errors.append((fn1, delta_pixels)) + return delta_pixels im1 = im1.getdata() im2 = im2.getdata() for i in range(3, pixels - 1, 3):