Score:2

Allow users to upload heic images and auto-convert to jpg

ru flag

It seems that heic images are increasingly popular way to store images (the default image format since ios 11, but browsers do not support them. Site visitors may attempt to upload an heic image from their phone to an image field, but the default file extension validation prevents that. If a site admin allows heic file extension for the field then the file can get uploaded, but is not displayed as an image because browsers don't support heic.

Drupal 7 has the Auto Upload Convert module which is not super popular, but attempts to solve this problem.

For Drupal 9+ I can't find a module or answer about how to solve the problem.

Jaypan avatar
de flag
Maybe this comment can help: https://www.drupal.org/project/imagemagick/issues/3153624#comment-13722267
leymannx avatar
ne flag
You convert the image on display not on upload. There should be a 'Convert' Image Style effect in core. If not, get it from contrib.
No Sssweat avatar
ua flag
First time I hear of "heic". `It seems that heic images are increasingly popular way to store images`. Yeah, [no browser supports heic...](https://caniuse.com/?search=HEIC) so I have my doubts about your "increasingly popular" statement. I use [webp](https://caniuse.com/?search=webp), you should consider it if you haven't already.
greggles avatar
ru flag
@NoSssweat I added some more context and citation to explain my perspective. I'm talking about a form where people are likely to use their phone to upload a photo and the iphone users either get an error message or the file doesn't render. The image format for images generated by website owners I agree webp is great, but that's a different question.
leymannx avatar
ne flag
@NoSssweat – I think all iPhones store their images as heic.
apaderno avatar
us flag
@leymannx Safari for iOS doesn't support those images, though. That doesn't help much who creates sites.
leymannx avatar
ne flag
@apaderno – Yeah, that's why I suggested convert on display via image style effect. (Not convert on upload. Store the original image, but display an image that's actually supported by browsers. Like WebP or what.)
apaderno avatar
us flag
@leymannx Converting the image when it's displayed is the way to go. (I apologize: I didn't read your first comment and I didn't understand your reply to the *browsers don't support the image type* argument.)
taggartJ avatar
cn flag
https://stackoverflow.com/a/67061824/4775955. this may help
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.