cordova-plugin-camera
cordova-plugin-camera copied to clipboard
On android tablet photo is 90 or 180 degrees rotated when I take a picture
Bug Report
Problem
I have an Android tablet (Zebra ET51 with android 10)I. If I have the tablet in landscape mode and take a picture, the picture is upside down. If I have the tablet in portrait mode and take a picture, the picture is 90 degrees rotated. In the preview in the camera app everything looks fine, but when I accept the photo and return to my cordova app, the picture is rotated. This only occurs with the camera on the back. The camera on the front is working fine.
What is expected to happen?
I expect the photo to be oriented as in the preview of the camera app.
What does actually happen?
The photo is 90 or 180 degrees rotated
Information
$ cordova platform ls Installed platforms: android 10.1.2 cordova-plugin-camera: ^6.0.0
Command or Code
navigator.camera.getPicture(
(imageData) => {
onGetPictureSuccess({ dataURL: `data:image/jpeg;base64,${imageData}`, photoUuid: uuid() });
},
onGetPictureFail,
{
quality: 25,
destinationType: Camera.DestinationType.DATA_URL,
cameraDirection: Camera.Direction.BACK,
correctOrientation: false,
},
);
I used all kind of cameraOptions but nothing seems to work.
Environment, Platform, Device
Android 10 tablet (Zebra ET51) cordova: 11.0.0 cordova-android 10.1.2 cordova-plugin-camera: 6.0.0
Version information
Checklist
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
I reported this to Zebra for a TC21. It was a bug in their camera app - it wasn't correctly adding exif orientation metadata to the image. They fixed it, but presumably not for all their devices if you're having trouble with a different model.
Hi, I have the same problem for smartphones with Android 13. How can I do?
correctOrientation
must be set to true