From f2ee02d3ca4c8033d120d8f681f4edf54dfa89ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Wed, 9 Jul 2014 15:17:51 -0700 Subject: [PATCH] allow specifying a maximum allowed difference in the info json --- scripts/compare_images.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/compare_images.js b/scripts/compare_images.js index f243753c3..3d33d4b50 100755 --- a/scripts/compare_images.js +++ b/scripts/compare_images.js @@ -60,9 +60,12 @@ function processFiles() { function writeResult(base, info, error, difference) { var color = 'green'; - if (difference > 0.01 && exitCode < 1) { - exitCode = 1; + var allowedDifference = ('diff' in info) ? info.diff : 0.01; + if (difference > allowedDifference) { color = 'red'; + if (exitCode < 1) { + exitCode = 1; + } } html +=