fix test & update deps

This commit is contained in:
lavrton
2015-08-28 10:11:10 +07:00
parent 445cf25731
commit 981f245833
10 changed files with 45 additions and 39 deletions

View File

@@ -11,7 +11,7 @@
var Canvas = require('canvas');
} catch (e) {
throw new Error(
e.message + '\n' +
e.message + '\n' +
'Please see https://github.com/HumbleSoftware/js-imagediff#cannot-find-module-canvas\n'
);
}
@@ -166,7 +166,12 @@
tolerance = tolerance || 0;
if (!equalDimensions(a, b)) return false;
for (i = length; i--;) if (aData[i] !== bData[i] && Math.abs(aData[i] - bData[i]) > tolerance) return false;
for (i = length; i--;) {
if (aData[i] !== bData[i] && Math.abs(aData[i] - bData[i]) > tolerance) {
console.log('Difference', Math.abs(aData[i] - bData[i]));
return false;
}
}
return true;
}