blueimp / jQuery-File-Upload

File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.
https://blueimp.github.io/jQuery-File-Upload/
MIT License
30.94k stars 7.95k forks source link

Way to upload Heic files and automatically transform it into jpg #3645

Open kainpro opened 4 years ago

kainpro commented 4 years ago

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,

blueimp commented 4 years ago

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

kainpro commented 4 years ago

Thank you very much for the information and response!

jakubzavrel commented 3 years ago

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

blueimp commented 3 years ago

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: