How can I achieve correct image orientation even if the device orientation is locked?

I am currently developing an app that relies on the camera. On iOS, typically you would expect the camera to be able to detect device orientation, even if the device screen is locked to the vertical position. So if you take a landscape photograph, the image orientation will be correct when viewing that image in the gallery.

I cannot find a way to do that with Expo. If the device orientation is locked to vertical, then a landscape image will appear at 90 degrees, and the user would be required to fix the orientation manually.

Does anyone know a way around that?

My objective is to have an image appear the correct way up regardless of whether device orientation is locked at the time the image is taken.

I’m also looking for a solution on this.

I ultimately decided to eject to Expo Kit in order to fix the problem.

I used the RNCamera module, which I believe is the same as used in Expo, but there was a recent commit to fix the problem using the device’s accelerometer. It works perfectly now. My guess is that this might make it into Expo SDK 31, but I don’t know.

Thanks @perrin. Hopefully they fix it in SDK 31.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.