jmarshall-com opened a new issue #690:
URL: https://github.com/apache/cordova-plugin-camera/issues/690
# Bug Report
On Android, calling getPicture() with the "correctOrientation: true" option
doesn't change the orientation at all.
## Problem
### What is expected to happen?
The picture is supposed to be reoriented to be upright, based on the
orientation of the camera/phone when it was taken.
### What does actually happen?
In portrait mode, regardless of the setting of correctOrientation (true,
false, or unstated), the new photo is rotated 90 degrees. If photo is taken
with front camera, it's rotated clockwise; if photo is taken with back camera,
it's rotated counterclockwise. In landscape mode with top of phone to the
left, the orientation is correct, but with the top of phone to the right the
photo is rotated 180 degrees.
## Information
This happens with both the Android emulator in Android Studio (using the
command line) and with a physical Pixel 2 XL. The target version is Android
7.1.1 (API 25).
If there is a way to detect which camera was used and its orientation, that
would enable a workaround in apps.
### Command or Code
```
let options= {quality: 100,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.CAMERA,
encodingType: Camera.EncodingType.PNG,
targetWidth: window.innerWidth,
targetHeight: window.innerWidth,
correctOrientation: true,
mediaType: Camera.MediaType.PICTURE,
saveToPhotoAlbum: false
} ;
let photo_url= await new Promise((resolve, reject) =>
navigator.camera.getPicture(resolve, reject, options)) ;
// further processing to display photo in <img> element
```
### Environment, Platform, Device
This happens with both the Android emulator on Linux and with a physical
Pixel 2 XL.
### Version information
Cordova 10.0.0
cordova-plugin-camera 5.0.1
Linux (openSuSE) kernel 4.12.14
Android 7.1.1 (API 25) in emulator
Android 11 on Pixel 2 XL
## Checklist
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [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
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]