Open Zigulich opened 1 year ago
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?
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.
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:
cameraRef.current.capture()
with the cell phone in landscape modeExpected 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 Locate at /node_modules/react-native-camera-kit/android/src/main/java/com/rncamerakit/CKCamera.kt:161