-
Notifications
You must be signed in to change notification settings - Fork 6k
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
fix: provide more image metadata in image-picker #29648
Conversation
@@ -10,7 +10,7 @@ | |||
"test:ios": "export NODE_ENV=\"test\" && ./scripts/start-simulator.sh", | |||
"test:android": "export NODE_ENV=\"test\" && ./scripts/start-emulator.sh", | |||
"edit:android": "open -a /Applications/Android\\ Studio.app ./android", | |||
"edit:ios": "open -a Xcode ./ios/BareExpo.xcworkspace", | |||
"edit:ios": "xed ./ios/BareExpo.xcworkspace", |
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.
this should be more robust: because I don't have Xcode.app in applications
(I have Xcode15_2 and Xcode15_3), this command failed. xed works for me. https://www.unix.com/man-page/osx/1/xed/
@@ -143,9 +143,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() | |||
if #available(iOS 14, *) { |
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.
the whole fn is wrapped in @available(iOS 14, *)
already (line 138)
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
It would be lovely if the same functionality could be added for the Expo documents picker. They have overlapping functionality, just different picker locations. |
Why
closes #29442 by adding extra metadata to the result of
ImagePicker.launchImageLibraryAsync
.Generally speaking, with these apis, it's easy to miss this or that piece of information because the information is scattered across various places, and there are even manufacturer-specific ones, such as for Minolta, Canon and others.
However, I believe the TIFF information should be commonly present and also brings the result closer to Android.
How
I'm taking metadata from
kCGImagePropertyTIFFDictionary
and merging it with the existingexif
dictionary. In case of duplicate keys, the exif value is preserved.I removed usage of
kCGImagePropertyOrientation
because the value, if present, is the same as the value in TIFF metadata source. The key is the same as well, though this is not confirmed by any docs.Test Plan
Tested on simulator and device
Checklist
No need to update docs, and the rest doesn't apply imo
npx expo prebuild
& EAS Build (eg: updated a module plugin).