Browse Source

Merge pull request #55 from lifeart/master

Large Base64 image files performance tweak
pull/60/head
James Cryer 9 years ago
parent
commit
5f6067198b
  1. 6
      resemble.js

6
resemble.js

@ -144,9 +144,15 @@ URL: https://github.com/Huddle/Resemble.js
var fileReader;
var hiddenImage = new Image();
if (!(typeof fileData === 'string'
&& fileData.length > 6
&& fileData.charAt(4)===':'
&& fileData.charAt(5)!=='/'
)) {
if (httpRegex.test(fileData) && !documentDomainRegex.test(fileData)) {
hiddenImage.setAttribute('crossorigin', 'anonymous');
}
}
hiddenImage.onerror = function () {
hiddenImage.onerror = null; //fixes pollution between calls

Loading…
Cancel
Save