I've been working on this code snippet:
const heicReader = new FileReader();
heicReader.onload = async () => {
const heicImageString = heicReader.result;
const { download_url } = await uploadPhotoToGcs({
base64: heicImageString,
type: 'image/png',
});
this.onSubmitImageMessage(download_url);
};
const blobUrl = URL.createObjectURL(imageData);
const blobRes = await fetch(blobUrl);
const imgBlob = await blobRes.blob();
const convertedFile = await heic2any({ blob: imgBlob });
heicReader.readAsDataURL(convertedFile);
return;
But I'm getting an error with
heicReader.readAsDataURL(convertedFile);
:
const convertedFile: Blob | Blob[]
Argument of type 'Blob | Blob[]' is not assignable to parameter of type 'Blob'.
Type 'Blob[]' is missing the following properties from type 'Blob': size, type, arrayBuffer, stream, text
Any ideas on what's causing this issue?