Ability to export mediatag images in pad

This commit is contained in:
yflory
2017-10-20 18:10:08 +02:00
parent a0dd867f33
commit 6d080bcb45
4 changed files with 62 additions and 23 deletions

View File

@@ -207,5 +207,19 @@ define([], function () {
return Array.prototype.slice.call(A);
};
Util.blobURLToImage = function (url, cb) {
var xhr = new XMLHttpRequest();
xhr.onload = function() {
var reader = new FileReader();
reader.onloadend = function() {
cb(reader.result);
};
reader.readAsDataURL(xhr.response);
};
xhr.open('GET', url);
xhr.responseType = 'blob';
xhr.send();
};
return Util;
});