Support for HEIC images

We have a lot of users uploading files. Apparently they are HEIC file from iPhone.

Is there a way to have these display inline for the post? (assuming this isn’t supported right now?)


Looks like this is a browser limitation:

heif covers both heif and heic and there’s No support for either in any mainstream browser at present


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.

1 Like

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: 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 jpeg site setting
  • add heic and/or heif to 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?

1 Like

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?

1 Like

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.