|
|
@ -59,6 +59,9 @@ URL: https://github.com/Huddle/Resemble.js |
|
|
|
|
|
|
|
|
|
|
|
var largeImageThreshold = 1200; |
|
|
|
var largeImageThreshold = 1200; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var httpRegex = /^https?:\/\//; |
|
|
|
|
|
|
|
var documentDomainRegex = new RegExp('^https?://' + document.domain); |
|
|
|
|
|
|
|
|
|
|
|
_this['resemble'] = function( fileData ){ |
|
|
|
_this['resemble'] = function( fileData ){ |
|
|
|
|
|
|
|
|
|
|
|
var data = {}; |
|
|
|
var data = {}; |
|
|
@ -131,7 +134,10 @@ URL: https://github.com/Huddle/Resemble.js |
|
|
|
function loadImageData( fileData, callback ){ |
|
|
|
function loadImageData( fileData, callback ){ |
|
|
|
var fileReader; |
|
|
|
var fileReader; |
|
|
|
var hiddenImage = new Image(); |
|
|
|
var hiddenImage = new Image(); |
|
|
|
hiddenImage.setAttribute("crossOrigin", "crossOrigin"); |
|
|
|
|
|
|
|
|
|
|
|
if (httpRegex.test(fileData) && !documentDomainRegex.test(fileData)) { |
|
|
|
|
|
|
|
hiddenImage.setAttribute('crossorigin', 'anonymous'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
hiddenImage.onload = function() { |
|
|
|
hiddenImage.onload = function() { |
|
|
|
|
|
|
|
|
|
|
|