pull/4881/head
tofulm 4 weeks ago committed by Matthieu Marcillaud
parent ff06b5304d
commit 2595152a57

@ -1105,7 +1105,15 @@ async function compress(file, maxWidth = 0, maxHeight = 0, quality = 85) {
}
const blob = await new Promise(resolve => data.image.toBlob(
blob => resolve(blob),
blob => {
if (data.imageHead) {
loadImage.replaceHead(blob, data.imageHead, function (newBlob) {
return resolve(newBlob);
})
} else {
return resolve(blob);
}
},
file.file.type,
quality
));

Loading…
Cancel
Save