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

launchImageLibraryAsync returns portrait video on iOS and Android with switched dimensions [Reopened] #15230

Closed
Aryk opened this issue Nov 17, 2021 · 6 comments
Labels
needs validation Issue needs to be validated stale

Comments

@Aryk
Copy link

Aryk commented Nov 17, 2021

Summary

Reopening a ticket from a year ago: #10909


Steps to reproduce:

  1. Run ImagePicker.launchImageLibraryAsync with mediaTypes = ImagePicker.MediaTypeOptions.All
  2. Select a portrait-oriented video (like for an instagram story) on the phone.
  3. 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.. . 🙉

Here is a file recorded with my iphone X to try on:

4D406363-471B-4D9A-BB43-F1415A681682.MOV

For example:

await ImagePicker.launchImageLibraryAsync({
  "exif": true,
  "mediaTypes": "All",
  "videoExportPreset": 2,
})  

Result is:

"cancelled": false,
  "duration": 3465,
  "height": 320,
  "type": "video",
  "width": 568,

Notice the dimensions are switched...

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

Android, iOS

SDK Version (managed workflow only)

43

Environment

Expo CLI 4.13.0 environment info:
System:
OS: macOS 11.1
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 14.12.0 - /usr/local/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 6.13.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /Users/aryk/.rvm/gems/ruby-2.6.0/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6514223
Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
npmPackages:
expo: ^43.0.0 => 43.0.3
react: 17.0.1 => 17.0.1
react-dom: 17.0.1 => 17.0.1
react-native: 0.64.3 => 0.64.3
npmGlobalPackages:
expo-cli: 4.4.4
Expo Workflow: managed

Reproducible demo or steps to reproduce from a blank project

  1. Run ImagePicker.launchImageLibraryAsync with mediaTypes = ImagePicker.MediaTypeOptions.All
  2. Select a portrait-oriented video (like for an instagram story) on the phone.
  3. 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).
@Aryk Aryk added the needs validation Issue needs to be validated label Nov 17, 2021
@Aryk
Copy link
Author

Aryk commented Nov 17, 2021

@mstach60161 - let me know if you want to zoom or something so I can help you repro it...its consistently broken on both platforms for me.

@github-actions
Copy link
Contributor

This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

@github-actions github-actions bot added the stale label Jan 19, 2022
@Aryk
Copy link
Author

Aryk commented Jan 20, 2022

bump

@github-actions github-actions bot removed the stale label Jan 20, 2022
@github-actions
Copy link
Contributor

This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

@github-actions github-actions bot added the stale label Mar 21, 2022
@github-actions
Copy link
Contributor

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.

@Aryk
Copy link
Author

Aryk commented Nov 9, 2023

Hey guys, maybe I can reopen this...this has been an issue on Expo since the beginning of time and is not fixed on Expo SDK 49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs validation Issue needs to be validated stale
Projects
None yet
Development

No branches or pull requests

1 participant