resemblejs
Advanced tools
Comparing version 2.0.1 to 2.1.0
{ | ||
"name": "resemblejs", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Image analysis and comparison with HTML5", | ||
@@ -5,0 +5,0 @@ "main": "resemble.js", |
@@ -151,3 +151,10 @@ /* | ||
hiddenImage.onerror = function () { | ||
hiddenImage.onerror = null; //fixes pollution between calls | ||
images.push({ error : "Image load error."}); | ||
callback(); | ||
}; | ||
hiddenImage.onload = function() { | ||
hiddenImage.onload = null; //fixes pollution between calls | ||
@@ -469,3 +476,4 @@ var hiddenCanvas = document.createElement('canvas'); | ||
data.misMatchPercentage = (mismatchCount / (height*width) * 100).toFixed(2); | ||
data.rawMisMatchPercentage = (mismatchCount / (height*width) * 100); | ||
data.misMatchPercentage = data.rawMisMatchPercentage.toFixed(2); | ||
data.diffBounds = diffBounds; | ||
@@ -536,2 +544,8 @@ data.analysisTime = Date.now() - time; | ||
if(images.length === 2){ | ||
if( images[0].error || images[1].error ){ | ||
data = {}; | ||
data.error = images[0].error ? images[0].error : images[1].error; | ||
triggerDataUpdate(); | ||
return; | ||
} | ||
width = images[0].width > images[1].width ? images[0].width : images[1].width; | ||
@@ -538,0 +552,0 @@ height = images[0].height > images[1].height ? images[0].height : images[1].height; |
Sorry, the diff of this file is not supported yet
115489
13
887