|
|
|
@ -77,12 +77,8 @@ URL: https://github.com/Huddle/Resemble.js
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function loadImageData( fileData, callback ){ |
|
|
|
|
var hiddenImage = new Image(); |
|
|
|
|
var fileReader = new FileReader(); |
|
|
|
|
|
|
|
|
|
fileReader.onload = function (event) { |
|
|
|
|
hiddenImage.src = event.target.result; |
|
|
|
|
}; |
|
|
|
|
var fileReader, |
|
|
|
|
hiddenImage = new Image(); |
|
|
|
|
|
|
|
|
|
hiddenImage.onload = function() { |
|
|
|
|
|
|
|
|
@ -101,7 +97,15 @@ URL: https://github.com/Huddle/Resemble.js
|
|
|
|
|
callback(imageData, width, height); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
fileReader.readAsDataURL(fileData); |
|
|
|
|
if (typeof fileData === 'string') { |
|
|
|
|
hiddenImage.src = fileData; |
|
|
|
|
} else { |
|
|
|
|
fileReader = new FileReader(); |
|
|
|
|
fileReader.onload = function (event) { |
|
|
|
|
hiddenImage.src = event.target.result; |
|
|
|
|
}; |
|
|
|
|
fileReader.readAsDataURL(fileData); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function isColorSimilar(a, b, color){ |
|
|
|
|