This commit is contained in:
Ross
2021-11-11 21:52:35 +00:00
parent 4a69102cfb
commit e27643faaa
+9
View File
@@ -451,6 +451,14 @@
}
}
async function blobToBase64(blob) {
return new Promise((resolve, _) => {
const reader = new FileReader();
reader.onloadend = () => resolve(reader.result);
reader.readAsDataURL(blob);
});
}
async function readFileAndProcess2(callback) {
file_set = $("#image_form_set input[type=file]");
@@ -471,6 +479,7 @@
let imageId;
if (el.files[0].type.startsWith("image")) {
imageId = `${url}`;
imageId = blobToBase64(url);
} else {
imageId = `wadouri:${url}`;
}