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

HEIF format not working #10

Closed jimneff440 closed 1 year ago

jimneff440 commented 4 years ago

Here is a sample file Link for file

GeorgeBelanger commented 2 years ago

I had this issue but found out that I was creating the blob in the wrong way. I was doing a

reader.onload = function(e) { const blob = new Blob([e.target.result]) img.src = heic2any({blob}) }

when what I needed to do was

     fetch(e.target.result)
        .then((res) => res.blob())
        .then((blob) => heic2any({
          blob
       })).then((conversionResult) => {
          var url = URL.createObjectURL(conversionResult);
          img.src = url;
        })
alexcorvi commented 1 year ago

Solved in the latest version.