capacitor-community / capacitor-community/camera-preview
Android - Orientation of B64 image upside down with Front Facing Camera
- Dominant language
- Java
- Stars
- 227
- Forks
- 185
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
When taking a photograph on the Samsung Galaxy A40 using the front facing camera on device, the finalised base64 image appears upside down, even after the supposed fix of #75. On NPM Version 2.0.0-beta0
**To Reproduce**
Load the camera preview and run `await CameraPreview.capture();` displaying the image in an img tag.
**Expected behavior**
The expected behaviour is that regardless of camera, the orientation should always be the right way up.
**Screenshots**


**Smartphone (please complete the following information):**
- Device: Samsung Galaxy A40
- OS: Android 10
**Additional context**
Oddly, the device has 3 cameras available: Back, Front (Really Zoomed In, but front camera) and Front (less zoomed in, [i'm guessing Ultrawide]). To get to the front facing camera i have to call the flip function twice, which led me to believe that the `cameraCurrentlyLocked == Camera.CameraInfo.CAMERA_FACING_FRONT` part of the `if` statement on L658 was blocking reaching the `switch` statement. Once i removed that part of the `if` statement it worked as expected, however this caused the back camera to (as you probably guessed), flip upside down.
I edited CameraActivity.java#658 to `if(cameraCurrentlyLocked != Camera.CameraInfo.CAMERA_FACING_BACK && disableExifHeaderStripping) {` and now everything seems to be working, although i don't know if this would work with cameras having multiple back facing cameras, therefore will not submit a pull request until more information has come in.
I do not know Java so i don't know what is at fault here.
Contributor guide
Assessment
This issue has not been assessed yet.