Browse Source

Merge branch 'Shadowblazen-master'

pull/34/head
James Cryer 10 years ago
parent
commit
d517565aef
  1. 8
      resemble.js

8
resemble.js

@ -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() {

Loading…
Cancel
Save