launchImageLibraryAsync returns portrait video on iOS and Android with switched dimensions
See original GitHub issueSteps to reproduce:
- Run ImagePicker.launchImageLibraryAsync with mediaTypes = ImagePicker.MediaTypeOptions.All
- Select a portrait-oriented video (like for an instagram story) on the phone.
- Notice that the width and height need to be flipped but there is no way to know that. The height should be the larger value (since it is a portrait video).
Managed SDK 39.0
Only hacky workaround for now that I see is:
const asset = await MediaLibrary.createAssetAsync(uri);
console.log(await MediaLibrary.getAssetInfoAsync(asset))
await MediaLibrary.deleteAssetsAsync([asset]);
which I have verified does return the width and height correctly. Unfortunately if you do await MediaLibrary.deleteAssetsAsync([asset]);
on iOS it will prompt the user if they want to delete this duplicate. The user does not know it is a duplicate so I will have to leave the extra duplicate on their system… . 🙉
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:17 (4 by maintainers)
Top Results From Across the Web
ImagePicker - Expo Documentation
expo-image-picker provides access to the system's UI for selecting images and videos from the phone's library or taking a photo with the camera....
Read more >react-native-image-picker vs expo ImagePicker - Stack Overflow
I'm using RN v0.60.4 with react-native-image-picker v1.0.1. Works fine on android emulator and ios simulator. It very well could be an issue ...
Read more >CHANGELOG.md · 熊刚/Expo - Gitee.com
(#6311 by @kyletsang); Added a videoExportPreset field to ImagePickerOptions , which sets dimensions and compression algorithm for exported video on iOS.
Read more >@expo/config-plugins | Yarn - Package Manager
(#9618 by @IjzerenHein); Fix orientation being returned incorrectly for videos in portrait mode in onReadyForDisplay on iOS. (#10449 by @lachenmayer) ...
Read more >CS50's Mobile App Development with React Native 2018
CS50 Video Player ... motion that has been exposed in iOS APIs · 0:47:30and also in Android APIs. ... 1:32:22But then when it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hey @Aryk! I don’t have much to add here- we try to cover as many issues as quickly & efficiently as we can. Investigating and fixing bugs like this takes some time, as I’m sure you know.
One way to help would be to identify the root cause of the issue, that way whoever makes the fix (whether it be an internal or external contributor) knows exactly where to begin
That’s correct. For Managed projects, fixes of this nature will be rolled out is with SDK releases. (Unless the bug is a major and widespread issue that calls for a minor/patch release like we saw with SDK39).