Browse Source

Large Base64 image files performance tweak

pull/55/head
Alex Kanunnikov 9 years ago
parent
commit
a1a41fc526
  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