Skip to content

Comments

[CLNP-8095] feat: Add preferredAssetRepresentationMode option to createExpoFileService#285

Merged
OnestarLee merged 2 commits intomainfrom
feat/expo-image-picker-options
Feb 5, 2026
Merged

[CLNP-8095] feat: Add preferredAssetRepresentationMode option to createExpoFileService#285
OnestarLee merged 2 commits intomainfrom
feat/expo-image-picker-options

Conversation

@OnestarLee
Copy link
Collaborator

@OnestarLee OnestarLee commented Feb 1, 2026

For Internal Contributors

CLNP-8095

Description Of Changes

  • Add ExpoFileServiceOptions type with imagePicker.preferredAssetRepresentationMode option
  • Add preferredAssetRepresentationMode to launchCameraAsync and launchImageLibraryAsync calls
  • Support three modes: automatic (default), compatible (convert HEIC/HEVC to JPEG/H.264), and current (keep original format)
  • iOS only feature for controlling HEIC/HEVC media format handling

Background

In expo-image-picker v17.0.0, the default for preferredAssetRepresentationMode changed from .automatic to .current:

[iOS] The default for preferredAssetRepresentationMode is now .current instead of .automatic. This keeps the asset in its original container/codec (e.g. HEIC instead of JPEG) and is required for the new fast-path. Apps that relied on .automatic re-encoded output can pass preferredAssetRepresentationMode: '.automatic' to restore the old behaviour. (#37569 by @hirbod)

This change exposes the option to UIKit users so they can control the behavior based on their needs.

Types Of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bugfix
  • New feature
  • Documentation (correction or otherwise)
  • Cosmetics (whitespace, appearance (ex) Prettier)
  • Build configuration
  • Improvement (refactor code)
  • Test

@codecov-commenter
Copy link

codecov-commenter commented Feb 1, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 10.87%. Comparing base (dabdd74) to head (c120369).

Files with missing lines Patch % Lines
...eact-native/src/platform/createFileService.expo.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #285      +/-   ##
==========================================
- Coverage   10.88%   10.87%   -0.01%     
==========================================
  Files         360      360              
  Lines        9053     9054       +1     
  Branches     2558     2438     -120     
==========================================
  Hits          985      985              
- Misses       7992     8068      +76     
+ Partials       76        1      -75     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@OnestarLee OnestarLee requested a review from bang9 February 1, 2026 05:14
Copy link
Collaborator

@bang9 bang9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • react-native-image-picker 에서도 assetRepresentationMode 로 동일한 기능 제공하더라구요! 요고도 추가해 놓으면 좋을 것 같습니다.
  • 기존에는 HEIC/HEIF 를 아예 파일로 취급을 했던지라 (UIKit 플랫폼 호환성 때문에), 옵션을 주는거보다 아예 기본값을 호환성 높은 포멧으로 변환해주는 compatible 로 주는건 어떨까요?
  • 제가 최근에 heic/heif 에서 mime type 이 안들어간다는 버그를 수정하면서, heic/heif 가 이미지로 취급이 되기 시작한 것 같습니다. 요고에 대한 수정도 #286 에 만들어두었습니다!

@OnestarLee OnestarLee force-pushed the feat/expo-image-picker-options branch from 3cd322d to c120369 Compare February 5, 2026 02:14
@OnestarLee
Copy link
Collaborator Author

기존에 추가한 option 삭제하고 react-native-image-picker 포함하여 compatible 로 수정하였습니다

@OnestarLee OnestarLee enabled auto-merge February 5, 2026 04:13
@OnestarLee OnestarLee disabled auto-merge February 5, 2026 04:25
@OnestarLee OnestarLee merged commit abbac16 into main Feb 5, 2026
6 checks passed
@OnestarLee OnestarLee deleted the feat/expo-image-picker-options branch February 5, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants