-
Notifications
You must be signed in to change notification settings - Fork 20
Description
iOS and iPadOS devices now store images as HEIC by default.
As long as "Automatic" or "Most Compatible" is seletect in the browser's upload sheet, the device will convert to JPEG on upload, but if "Current" is selected or the uploader is dragging and dropping from the Photos app on their Mac, an HEIC file will be uploaded and refused.
A big problem with HEIC is that only Safari supports displaying it https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format#Support so many services simply don't accept it.
A few services do accept HEIC and take on the conversion to JPEG themselves, and maybe MLTSHP could be one of them.
My knowledge in this space is unfortunately limited to just research, but here's how WordPress does HEIC conversion to JPEG on upload:
- https://core.trac.wordpress.org/ticket/53645
- https://make.wordpress.org/core/2024/08/15/automatic-conversion-of-heic-images-to-jpeg-in-wordpress-6-7/
They experimented with client-side processing but ran into some licensing issues WordPress/gutenberg#61447 but maybe this is something that Fastly could do for us? https://www.fastly.com/documentation/reference/io/
I also asked @newbold who runs https://some.pics which converts HEIC uploads to JPEG, and he gave permission to share that they use heif-convert as a command line utility:
// convert heic/heif if($mime === 'image/heic' || $mime === 'image/heif') { $uploaded_pic_jpg = tempnam("/tmp", "some.pics.jpg."); $convert = shell_exec("heif-convert $uploaded_pic $uploaded_pic_jpg.jpg"); $uploaded_pic = $uploaded_pic_jpg.'.jpg'; $mime = 'image/jpeg'; unlink($uploaded_pic_jpg); }