IOS 14.x 版本 canvas.toDataURL 返回 data:; ,其它平台正常。?
function compressImage(file){
let cvs = document.getElementById('compress-canvas');
let newImage = new Image();
let fileCache = file;
newImage.src = file.content;
newImage.onload = () => {
if (newImage.complete) {
cvs.width = newImage.naturalWidth;
cvs.height = newImage.naturalHeight;
cvs.getContext('2d').drawImage(newImage, 0, 0, newImage.naturalWidth, newImage.naturalHeight);
const newImageData = cvs.toDataURL(mime_type, 0.5);
// newImageData 居然为data:;
}
};
}