jQuery-File-Upload icon indicating copy to clipboard operation
jQuery-File-Upload copied to clipboard

Way to upload Heic files and automatically transform it into jpg

Open kainpro opened this issue 5 years ago • 4 comments

Hello good morning with the new format that is available in some devices I would like to know if, as well as when capturing a photo, the same plugin transforms the image to jpg, if there is an identical way to upload files saved in heic format, transform it to jpg?

Greetings,

kainpro avatar May 15 '20 17:05 kainpro

Hello @kainpro, thanks for your suggestion, I've marked this as a feature request.

I found the following library that supports converting HEIC/HEIF images to JPEG/PNG/GIF on the client-side: https://github.com/alexcorvi/heic2any

It's unlikely that I would include this though, as the distribution file for heic2any is more than a Megabyte in size.

I think until browsers support this format natively, you're better off implementing this on the server-side, e.g. using libheif: https://github.com/strukturag/libheif

blueimp avatar May 15 '20 18:05 blueimp

Thank you very much for the information and response!

kainpro avatar May 18 '20 16:05 kainpro

Hi @blueimp, I am using your amazing file upload, but main focus is upload from phones. iPhone and Android phones are using jpg/png less and less, but heic/heif is in systems of both platforms more and more. Could you please reconsider implementing any kind of heic/heif transform to jpg as was asked orginaly above? Browsers cant handle heic/heif but phones takes photos in this format 8)

Heic2any looks promising, but I dont know how to implement it. My idea was to implement it into your _onAdd function in jquery.fileupload.js if file is heic/heif via this suggestion: https://stackoverflow.com/questions/57127365/make-html5-filereader-working-with-heic-files unfortunately I dont know how to rework you functions to async functions so I am stuck 8(

May I ask you about any suggestion or implementing any solution from your side?

thx for answer

jakubzavrel avatar Sep 22 '21 18:09 jakubzavrel

Hi @jakubzavrel, any file processing should be done via the processing queue. Unfortunately there is no documentation, but you might get an idea by reading the source for these files:

  • https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.fileupload-process.js
  • https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.fileupload-image.js

blueimp avatar Sep 25 '21 03:09 blueimp