-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat(android): convert HEIC to JPEG #2264
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
feat(android): convert HEIC to JPEG #2264
Conversation
BREAKING CHANGE: automatically convert HEIC files to JPEG on Android if assetRepresentationMode is not set to current
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is a short and good solution, works perfectly.
Having issues with newer samsung phones saving in HEIC; would love to see this integrated. |
Friendly bump. Currently HEIC seems basically impossible to manage in React Native but certainly users expect it to "just work." |
been using khitrin's branch in production and it's been fine. now we're being forced to update our android to use the photo picker. could someone please merge this? |
🎉 This PR is included in version 8.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hmm think "image/heif" support would be nice as well. my camera saved it as image/heif on my phone. |
# [8.0.0](react-native-image-picker/react-native-image-picker@v7.2.3...v8.0.0) (2025-02-01) * feat(android)!: convert HEIC to JPEG (#2264) ([9df11bc](react-native-image-picker/react-native-image-picker@9df11bc)), closes [#2264](react-native-image-picker/react-native-image-picker#2264) ### BREAKING CHANGES * automatically convert HEIC files to JPEG on Android if assetRepresentationMode is not set to current
# [8.1.0](react-native-image-picker/react-native-image-picker@v8.0.0...v8.1.0) (2025-02-16) ### Features * add support for converting image/heif to jpeg relates to [#2264](react-native-image-picker/react-native-image-picker#2264) ([#2357](react-native-image-picker/react-native-image-picker#2357)) ([ce350a1](react-native-image-picker/react-native-image-picker@ce350a1))
# [8.0.0](react-native-image-picker/react-native-image-picker@v7.2.3...v8.0.0) (2025-02-01) * feat(android)!: convert HEIC to JPEG (#2264) ([9df11bc](react-native-image-picker/react-native-image-picker@9df11bc)), closes [#2264](react-native-image-picker/react-native-image-picker#2264) ### BREAKING CHANGES * automatically convert HEIC files to JPEG on Android if assetRepresentationMode is not set to current
# [8.1.0](react-native-image-picker/react-native-image-picker@v8.0.0...v8.1.0) (2025-02-16) ### Features * add support for converting image/heif to jpeg relates to [#2264](react-native-image-picker/react-native-image-picker#2264) ([#2357](react-native-image-picker/react-native-image-picker#2357)) ([ce350a1](react-native-image-picker/react-native-image-picker@ce350a1))
# [8.0.0](react-native-image-picker/react-native-image-picker@v7.2.3...v8.0.0) (2025-02-01) * feat(android)!: convert HEIC to JPEG (#2264) ([9df11bc](react-native-image-picker/react-native-image-picker@9df11bc)), closes [#2264](react-native-image-picker/react-native-image-picker#2264) ### BREAKING CHANGES * automatically convert HEIC files to JPEG on Android if assetRepresentationMode is not set to current
# [8.1.0](react-native-image-picker/react-native-image-picker@v8.0.0...v8.1.0) (2025-02-16) ### Features * add support for converting image/heif to jpeg relates to [#2264](react-native-image-picker/react-native-image-picker#2264) ([#2357](react-native-image-picker/react-native-image-picker#2357)) ([ce350a1](react-native-image-picker/react-native-image-picker@ce350a1))
# [8.0.0](react-native-image-picker/react-native-image-picker@v7.2.3...v8.0.0) (2025-02-01) * feat(android)!: convert HEIC to JPEG (#2264) ([9df11bc](react-native-image-picker/react-native-image-picker@9df11bc)), closes [#2264](react-native-image-picker/react-native-image-picker#2264) ### BREAKING CHANGES * automatically convert HEIC files to JPEG on Android if assetRepresentationMode is not set to current
# [8.1.0](react-native-image-picker/react-native-image-picker@v8.0.0...v8.1.0) (2025-02-16) ### Features * add support for converting image/heif to jpeg relates to [#2264](react-native-image-picker/react-native-image-picker#2264) ([#2357](react-native-image-picker/react-native-image-picker#2357)) ([ce350a1](react-native-image-picker/react-native-image-picker@ce350a1))
# [8.0.0](react-native-image-picker/react-native-image-picker@v7.2.3...v8.0.0) (2025-02-01) * feat(android)!: convert HEIC to JPEG (#2264) ([9df11bc](react-native-image-picker/react-native-image-picker@9df11bc)), closes [#2264](react-native-image-picker/react-native-image-picker#2264) ### BREAKING CHANGES * automatically convert HEIC files to JPEG on Android if assetRepresentationMode is not set to current
# [8.0.0](react-native-image-picker/react-native-image-picker@v7.2.3...v8.0.0) (2025-02-01) * feat(android)!: convert HEIC to JPEG (#2264) ([9df11bc](react-native-image-picker/react-native-image-picker@9df11bc)), closes [#2264](react-native-image-picker/react-native-image-picker#2264) ### BREAKING CHANGES * automatically convert HEIC files to JPEG on Android if assetRepresentationMode is not set to current
BREAKING CHANGE: automatically convert HEIC files to JPEG on Android if assetRepresentationMode is not set to current
Thanks for submitting a PR! Please read these instructions carefully:
main
branch, NOT a "stable" branch.Motivation (required)
Some Android phones (Samsung for example) take photos in HEIC format like iPhones.
The library converts HEIC to JPEG on iOS using preferredAssetRepresentationMode, but the Android picker seems to lack this ability.
Sharing unconverted HEICs is very inconvenient because many clients cannot display them.
The change adds an ability to the library to mimic the iOS behaviour and convert selected HEIC files to JPEG on Android.
Support for preferredAssetRepresentationMode option has been added to Android to provide an opt-out for this conversion working exactly the same as on iOS. If a user wants to select the original file they can set it to "current" as they already do on iOS.
Also conversionQuality option has been added to set the desired quality of converted images because existing quality option must be set to 1 to avoid JPEG-to-JPEG conversion. Default value 92 is chosen as same to the ImageMagick defaults.
Test Plan (required)