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

[ios][image-picker] Add preferredAssetRepresentationMode to image picker #22456

Merged
merged 3 commits into from
May 19, 2023
Merged

[ios][image-picker] Add preferredAssetRepresentationMode to image picker #22456

merged 3 commits into from
May 19, 2023

Conversation

thespacemanatee
Copy link
Contributor

@thespacemanatee thespacemanatee commented May 11, 2023

Why

How

  • 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

  • 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

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label May 11, 2023
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels May 11, 2023
Copy link
Contributor

@lukmccall lukmccall left a comment

Choose a reason for hiding this comment

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

Looking good 🏅
Thanks for your contribution.
Please, apply my suggestions.

@@ -142,6 +142,7 @@ public class ImagePickerModule: Module, OnMediaPickingResultHandler {
// selection limit = 1 --> single selection, reflects the old picker behavior
configuration.selectionLimit = options.allowsMultipleSelection ? options.selectionLimit : SINGLE_SELECTION
configuration.filter = options.mediaTypes.toPickerFilter()
configuration.preferredAssetRepresentationMode = options.preferredAssetRepresentationMode.toAssetRepresentationMode()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
configuration.preferredAssetRepresentationMode = options.preferredAssetRepresentationMode.toAssetRepresentationMode()
if #available(iOS 14, *) {
configuration.preferredAssetRepresentationMode = options.preferredAssetRepresentationMode.toAssetRepresentationMode()
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lukmccall Thank you, I've added it!

@thespacemanatee thespacemanatee requested a review from lukmccall May 17, 2023 12:33
@lukmccall lukmccall merged commit 0032da7 into expo:main May 19, 2023
lukmccall pushed a commit that referenced this pull request May 22, 2023
# Why

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

In my previous PR #22456, I added the changelog entry under the wrong version, it should be under `Unpublished` instead of `14.2.0`, my bad.

# How

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

- Move the entry to `Unpublished`

# 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.
-->

# 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).
@tsapeta tsapeta added the published Changes from the PR have been published to npm label Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: passed checks ExpoBot has nothing to complain about published Changes from the PR have been published to npm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ImagePicker] - Is there a way to avoid saving a large video to app cache?
4 participants