Penjimon
Penjimon

Reputation: 509

C#/javascript, Convert Apple's new HEIC image format to JPG

So I know this question has been asked several times, but I can NOT find a clear, definitive answer.

I am trying to use pure HTML5 & AJAX/C# (nothing else if possible) to simply capture a photo, from a mobile page (not an app), via IOS/Android. So far with the code I have, everything works fine for Android, but the issue is IOS' new HEIC image format.

My goal is to convert the HEIC image, captured by the form input, and convert it to JPG before sending it to the server.

Could someone please explain how to do this, (in a little detail), and also include any dependencies/libraries that are needed to do it.

PS: I am very aware of Nokia's GitHub project (which doesn't work), and also the overly expensive API that does it for you.

Upvotes: 4

Views: 2431

Answers (1)

Alex C.
Alex C.

Reputation: 4081

Came across your question looking for answers but sadly didn't find any :( However, I've been successful to do the conversion using libheif.

I've created this repository which uses libheif but with much simpler API. This can only be used in the browser, and the resulting image won't retain any metadata. However, it will work as you would expect.

Here's a demo: https://alexcorvi.github.io/heic2any/#try

Upvotes: 1

Related Questions