inaturalist / iNaturalistReactNative

Cross-platform version of the iNat mobile app
MIT License
70 stars 25 forks source link

Cameras not ignoring orientation lock #2251

Open kueda opened 1 month ago

kueda commented 1 month ago

Describe the bug When the device has orientation lock on, the app won't let you take a landscape orientation photo like factory camera apps do.

To Reproduce Steps to reproduce the behavior:

  1. Turn on orientation lock
  2. Open the StandardCamera
  3. Rotate the device 90 degrees into landscape orientation
  4. Take a picture
  5. Rotate the device back into portrait orientation
  6. The photo you took is rotated 90 degrees

Expected behavior Both cameras should ignore orientation lock if turned on, just like the default Apple and Google cameras do. IMO the UI (like the camera buttons) should also respond to rotation even if orientation lock is on.

Context (please complete the following information):

Additional context Not sure if you have an opinion on this, @abhasinat, but it seems buggy to me. I'm assuming you want it to work the same way the Apple camera works.

abhasinat commented 2 weeks ago

I agree this is a good idea

jtklein commented 2 weeks ago

We are currently using react-native-vision-camera version 4.0.5. Version 4.1.0 introduces a complete rewrite of the way orientation is handled. Our vision-plugin does not yet support this version but one day should.

Maybe best to revisit this issue until vision-camera is updated to >4.1.0.

albullington commented 4 days ago

I'm not currently finding any way to override the orientation lock on the camera -- our react-native-orientation-locker library has a method called getAutoRotateState that is only available on Android, and will return true every time regardless of actual orientation lock status on iOS.

I made an issue in vision-camera-plugin-inatvision to support the latest version of react-native-vision-camera, since I agree with Johannes that we'd have better luck upgrading and removing all of our patchy orientation code before revisiting this issue.