Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Support converting HEIF images to JPEG #10079

Merged
merged 6 commits into from
Jul 23, 2020
Merged

FEATURE: Support converting HEIF images to JPEG #10079

merged 6 commits into from
Jul 23, 2020

Conversation

pmusaraj
Copy link
Contributor

@pmusaraj pmusaraj commented Jun 18, 2020

This is an optional feature (default off) to convert HEIF images (like live photos from iOS devices, for example) to be converted to jpegs when uploaded. Browsers do not support rendering HEIFs at this time.

Requires allowing heic and/or heif in the authorized_extensions site setting.

Developers on non-Mac machines will need to ensure ImageMagick includes HEIC support, otherwise the specs will not pass. See also discourse/install-rails#21.

@pmusaraj pmusaraj marked this pull request as draft June 18, 2020 15:07
@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/support-for-heic-images/144326/13

@ZogStriP
Copy link
Member

I wonder, can we do this on the client-side? How CPU-intensive is it? Any ideas?

@pmusaraj
Copy link
Contributor Author

pmusaraj commented Jul 7, 2020

@ZogStriP There is a library that can do this client-side, see https://github.com/alexcorvi/heic2any for an implementation but this seems considerably trickier. Heic2any does not retain metadata, which makes it less useful for converting files at upload. The library maintainer suggests it be used for display purposes only. But, while storing HEICs is more efficient (better compression), it would complicate lots of things in our upload pipeline, since HEICs aren't recognized as images (no thumbnail or optimized image generation, markup would need to be converted from an attachment to an image, etc).

Also, the client-side library is quite large, at 1.15Mbs minified.

@pmusaraj pmusaraj marked this pull request as ready for review July 16, 2020 14:46
@pmusaraj pmusaraj merged commit 7559758 into master Jul 23, 2020
@pmusaraj pmusaraj deleted the heif-support branch July 23, 2020 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants