Skip to content

Commit

Permalink
[ios][image-picker] Add preferredAssetRepresentationMode to image pic…
Browse files Browse the repository at this point in the history
…ker (#22456)

# Why

<!--
Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests.
-->

- Resolves #21707
- The issue above is not that copying to cache is slow, but that some videos are transcoded into a more compatible format which is done on the fly and takes a lot of time
- `preferredAssetRepresentationMode` gives us the option to skip transcoding

# How

<!--
How did you build this feature or fix this bug and why?
-->

- Added a new enum with proper documentation
- Add this new enum as an option in `ImagePickerOptions`
- Handle this in the native side following the code style of the module

# Test Plan

<!--
Please describe how you tested this change and how a reviewer could reproduce your test, especially if this PR does not include automated tests! If possible, please also provide terminal output and/or screenshots demonstrating your test/reproduction.
-->

- Ran the `bare-expo` app on iOS
- Imported `expo-image-picker` and launched the photo library picker with all the options
- Tested a `.hevc` video with `automatic` and `current`, `current` is much faster

# Checklist

<!--
Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules.
-->

- [x] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md).
- [x] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [x] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin).
  • Loading branch information
thespacemanatee authored May 19, 2023
1 parent d69f28f commit 0032da7
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/expo-image-picker/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
### 🎉 New features

- Added ability to choose the camera-facing type. ([#22143](https://github.com/expo/expo/pull/22143) by [@YoussefHenna](https://github.com/YoussefHenna))
- Added ability to choose the preferred asset representation mode on iOS 14+. ([#22456](https://github.com/expo/expo/pull/22456) by [@thespacemanatee](https://github.com/thespacemanatee))

### 🐛 Bug fixes

Expand Down
26 changes: 26 additions & 0 deletions packages/expo-image-picker/build/ImagePicker.types.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions packages/expo-image-picker/build/ImagePicker.types.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0032da7

Please sign in to comment.