resemblejs
Advanced tools
Comparing version 1.2.0 to 1.2.1
{ | ||
"name": "resemblejs", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Image analysis and comparison with HTML5", | ||
@@ -5,0 +5,0 @@ "main": "resemble.js", |
@@ -63,2 +63,3 @@ /* | ||
var httpRegex = /^https?:\/\//; | ||
var document = typeof window != "undefined" ? window.document : {}; | ||
var documentDomainRegex = new RegExp('^https?://' + document.domain); | ||
@@ -383,2 +384,14 @@ | ||
var mismatchCount = 0; | ||
var diffBounds = { | ||
top: height, | ||
left: width, | ||
bottom: 0, | ||
right: 0 | ||
}; | ||
var updateBounds = function(x, y) { | ||
diffBounds.left = Math.min(x, diffBounds.left); | ||
diffBounds.right = Math.max(x, diffBounds.right); | ||
diffBounds.top = Math.min(y, diffBounds.top); | ||
diffBounds.bottom = Math.max(y, diffBounds.bottom); | ||
} | ||
@@ -419,2 +432,3 @@ var time = Date.now(); | ||
mismatchCount++; | ||
updateBounds(horizontalPos, verticalPos); | ||
} | ||
@@ -439,2 +453,3 @@ return; | ||
mismatchCount++; | ||
updateBounds(horizontalPos, verticalPos); | ||
} | ||
@@ -444,2 +459,3 @@ } else { | ||
mismatchCount++; | ||
updateBounds(horizontalPos, verticalPos); | ||
} | ||
@@ -450,2 +466,3 @@ | ||
data.misMatchPercentage = (mismatchCount / (height*width) * 100).toFixed(2); | ||
data.diffBounds = diffBounds; | ||
data.analysisTime = Date.now() - time; | ||
@@ -452,0 +469,0 @@ |
19176
522