Skip to content

fix: photo orientation#1915

Closed
cimigree wants to merge 6 commits into
developfrom
fix/photo-orientation
Closed

fix: photo orientation#1915
cimigree wants to merge 6 commits into
developfrom
fix/photo-orientation

Conversation

@cimigree

@cimigree cimigree commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

towards #1872
Turns out we cannot update to react-native-vision-camera version 5 without the new architecture. This is not well documented and took me a while to figure out.

So this fix is attempting to override whatever EXIF orientation vision camera wrote (correct or not) with this command: await Exify.write(raw.uri, {Orientation: 1};

Then after that we apply our home grown rotation using the accelerometer.

The manipulateAsync API got deprecated so now I made a wrapper/ helper for the suggested replacement (ImageManipulator.manipulate) since we use that behavior 3 times.

Also, in order to display the photo in the correct orientation, we have to calculate the layout using the accelerometer data

At this point, this fix works for my three devices (two Samsungs and a Pixel running Android 15 & 16) but not for a Motorola (Moto G4) testing device running Android 14.

It would be helpful to know why, so an idea is to see what the Exif value is for four different scenarios (portrait upright, landscape right, portrait upside down, landscape left). Then we can ascertain if possibly vision camera is writing wrong EXIF on that device. If not, we are stuck and have to wait for upgrade to vision camera 5.

I have added temporary Sentry logging in case we want to debug this further so that we can see what the Exif Orientation is for a tester since different devices could possibly be using different values.

We could do an apk build and check Sentry for the Motorola to see what might be going on..

@cimigree cimigree requested a review from ErikSin June 8, 2026 14:50
@ErikSin

ErikSin commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

closing as we are descoping until we switch to the new architecture

@ErikSin ErikSin closed this Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants