cordova-plugin-camera icon indicating copy to clipboard operation
cordova-plugin-camera copied to clipboard

On android tablet photo is 90 or 180 degrees rotated when I take a picture

Open marioklaver opened this issue 2 years ago • 3 comments

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

marioklaver avatar Jul 20 '22 18:07 marioklaver

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.

cumpstey avatar Oct 12 '22 13:10 cumpstey

Hi, I have the same problem for smartphones with Android 13. How can I do?

giuliastully avatar Dec 05 '22 10:12 giuliastully

correctOrientation must be set to true

mariusvn avatar Nov 27 '23 10:11 mariusvn