Ugh. So annoying Apple.
I’d say #pr-welcome for allowing users to upload those and converting those from HEIC to JPEG.
Is there an existing pipeline that does something similar that you could point a contributor to?
There is this:
And there are some accompanying specs at upload_creator_spec.rb.
I think this would be a really awesome upgrade and doesn’t look like HEIC is going away…Thanks if someone can figure it out!
To be clear this won’t add HEIC support. Images will be converted using a different lossy method and lose a tiny bit of fidelity in the process.
Any live photos shared as HEIC will become a still image, and while HEIC can support transparency, JPEG does not.
The equivalent JPEG is about twice the size.
Understand. I’m ok with the tradeoffs.
Any traction on this one?
Not at the current time, no. Did you want to sponsor the feature or submit a PR?
I took a crack at this yesterday. I work on a Mac, and this was pretty straightforward on my machine, so I set up this PR: FEATURE: Support converting HEIF images to JPEG by pmusaraj · Pull Request #10079 · discourse/discourse · GitHub however ImageMagick on Linux machines does not come with HEIC support out of the box, so we can’t merge this until we update the base Docker image to include HEIC support.
I’ll work on that now, but this will take a bit longer to get to core.
This feature is now merged in core and the base image bas been updated.
To enable HEIC/HEIF support, you need to:
- enable the
convert heif to jpegsite setting
heifto the authorized extensions for uploads on your site
If you are hosted with us, this feature should be available already (if it isn’t, shoot us a quick message).
For self-hosters, you need to update the base image and rebuild:
cd /var/discourse git pull ./launcher rebuild app
Do you mean the site setting is enabled by default on our hosting?
No, it’s not enabled by default, I just meant that the new setting should be there on our hosting.
Is there any reason it should not be enabled by default on our hosting?
Does it even need to be a setting?
Discourse isn’t a file manager, if people want to share the HEIC files they could just link to it hosted elsewhere?
I can’t see it doing any significant harm?
I guess you’re right, the setting only adds a hurdle. It’s easy to remove.
Should we also add .heif/.heic to the default
authorized extensions site setting @codinghorror?
Sure, whatever is easiest works for me!
Ideally this should just work out of the box, right?
Other uploads are already optimized, HEIC is just being optimized ‘a little further’ to cater for browser compatibility issues.
I made the changes described above last week, HEIC conversion to JPEG is enabled by default (no need to turn any knobs). Heif/heic extensions have also been added to the
authorized extensions setting defaults, sites that have modified that setting will need to add the extensions manually.
I know I am late, but Thanks. This is super cool.