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

Ignoring user orientation settings #624

Open
Zigulich opened this issue Nov 29, 2023 · 2 comments
Open

Ignoring user orientation settings #624

Zigulich opened this issue Nov 29, 2023 · 2 comments

Comments

@Zigulich
Copy link

Describe the bug
I had several problems with the user orientation being blocked when capturing a photo. Even changing the android:screenOrientation property or locking the rotation with third-party plugins, I realized that the code itself had a function to "Rotate the image according to device orientation, even when UI orientation is locked"

To Reproduce
Steps to reproduce the behavior:

  1. Call cameraRef.current.capture() with the cell phone in landscape mode
  2. Even if the orientation is locked, the capture is done in landscape mode

Expected behavior
The image orientation must be defined by the user, and not forced.
The best option would be to add a property to the capture function, determining whether or not the orientation should be locked.

Screenshots
image
Locate at /node_modules/react-native-camera-kit/android/src/main/java/com/rncamerakit/CKCamera.kt:161

@DavidBertet
Copy link
Contributor

It is the expected behavior.

It is recommended to lock the UI orientation in portrait mode while capturing for UX purposes. However the resulting image takes into account the device orientation.
If the user rotated their phone while taking the picture, it takes a landscape image as expected by the user (same as the native camera app).

Could you explain why you aren't expecting this behavior in your case?

@Zigulich
Copy link
Author

My case is specific, where images must only be sent in portrait mode.

Both react-native-camera and its successor react-native-vision-camera allow the configuration of orientation at the time of capture, as the developer must have control of the expected return, and in specific cases like mine, it can easily get stuck rotation, whether in portrait mode or landscape mode.

In my case, I forked the repository and removed this part of the code in my app, but it would be interesting if the app allowed configuration more easily.

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

No branches or pull requests

2 participants