expo: launchImageLibraryAsync returns portrait video on iOS and Android with switched dimensions

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… . 🙉

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 17 (5 by maintainers)

Most upvoted 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).