apache / apache/cordova-plugin-camera

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

Open
#801 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
976
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

# 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

Contributor guide

Open the contributing guide

Research direction

Start with the navigator.camera.getPicture entry point and its cameraDirection, destinationType, and correctOrientation options, then trace the Android camera flow for the rear camera. Reproduce the issue on the Zebra ET51 in portrait and landscape modes, and verify that the returned photo orientation matches the camera preview.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.