alexcorvi / heic2any

Converting HEIF/HEIF image formats to PNG/GIF/JPEG in the browser
https://alexcorvi.github.io/heic2any/
MIT License
585 stars 74 forks source link

Does not work on Safari #55

Open jonathanrstern opened 6 months ago

jonathanrstern commented 6 months ago

Here is my convertHeic function:

export async function convertHeic(heicFile: File) {
  const heic2any = require("heic2any");
  const convertedBlob = await heic2any({ blob: heicFile });
  const convertedFile = new File([convertedBlob], `${uuidv4()}.png`, {
    type: "image/png",
  });
  return { convertedBlob, convertedFile };
}

Here is my convertedFile:

convertedFile = {
    lastModified: 1702502344687,
    name: "23b275b5-b261-4fa2-b240-3c878d9047b8.png",
    size: 213143,
    type: "image/png",
    webkitRelativePath: ""
}

Working beautifully on Chrome. Breaks on Safari --> photo simply displays as a transparent box.

Using NextJS.

@alexcorvi any thoughts?

khot-aditya commented 3 months ago

@jonathanrstern hey, any updates or work arounds to this issue? It is still open