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

Incorrect Orientation on Windows 10

Open MSwapna428 opened this issue 5 years ago • 6 comments

Bug Report: Incorrect Orientation on Windows 10

We tried setting up with correctOrientation parameter and still the issue exist. The issue was fine until 2.3.1. After upgrading to 4.0.3, the orientation data is lost.

Problem : Took a pic in portrait mode, but its retained in landscape.

What is expected to happen? Retain orientation.

What does actually happen? Orientation is lost.

Information

cordova platform list Installed platforms: windows 6.0.1

cordova plugins list at.gofg.sportscomputer.powermanagement 1.1.2 "PowerManagement" cordova-plugin-camera 4.0.3 "Camera" cordova-plugin-dialogs 1.3.1 "Notification" cordova-plugin-file 6.0.1 "File" cordova-plugin-file-opener2 2.2.0 "File Opener2" cordova-plugin-network-information 2.0.1 "Network Information" cordova-plugin-splashscreen 4.0.1 "Splashscreen" cordova-plugin-whitelist 1.3.1 "Whitelist" cordova-sqlite-legacy-build-support 1.3.4 "Cordova sqlite legacy build support" cordova-sqlite-storage 2.0.2 "Cordova sqlite storage plugin"

MSwapna428 avatar Apr 29 '19 04:04 MSwapna428

i am having the same issue

sushilsunuwar avatar Apr 29 '19 15:04 sushilsunuwar

I am having the same issue with Android and Windows 10 and I have already tried with correctOrientation: true.

gabrielberlanda avatar May 09 '19 17:05 gabrielberlanda

Changing from PNG to JPEG solved the orientation issue in my case, maybe the problem is just in PNG images.

gabrielberlanda avatar May 10 '19 12:05 gabrielberlanda

Guys, I'm sorry, the comment above just worked for android, with Windows the orientation error still hapenned.

gabrielberlanda avatar May 21 '19 18:05 gabrielberlanda

I'll be picking this ticket up in our upcoming sprint. If anyone is alerted by this message and has any new information, I would be greatly appreciative. I'll report back findings as they arise.

This is the options I'm passing to getPicture() // this.camera is ionic-native/camera import const options: CameraOptions = { quality: 25 , destinationType: this.camera.DestinationType.NATIVE_URI , encodingType: this.camera.EncodingType.JPEG , mediaType: this.camera.MediaType.PICTURE , sourceType: source , correctOrientation: true };

Note: "allowEdit: true" here gave an interesting UI to zoom / pan the image, and did end up keeping the correct orientation.

PabbleDabble avatar Jan 15 '20 18:01 PabbleDabble

@MSwapna428 Do you happen to remember what device you were using? (Apologies if you're not supposed to mention people like that).

I develop an app that runs on a Windows Surface and running through the CameraProxy.js code, there is no path in that code that accesses the sensor (there is a bunch of code in this that deals with the sensor and orientation but that only seems to matter for the Windows phone).

I've manually changed some of the code in testing and am able to use the native devices sensor to detect orientation and onOrientationChange events, however once the picture is captured I have no way to rotate it to match before saving the file and returning it back to my app.

PabbleDabble avatar Jan 17 '20 14:01 PabbleDabble

Cordova Windows has been deprecated and is no longer supported making this issue obsolete.

erisu avatar Dec 19 '22 04:12 erisu