Open websitedesignanddeveloper opened 5 years ago
I had the same issue. correctOrientation not working either on my android device nor my ios device.
Multiple people have posted about this bug over time, but no one could say anything on how to fix it.
Issue
editAllow and correctOrientation not working properly everytime
Description
Tried on vivo and oppo devices Oppo - Camera - working editAllow or correctOrientation one of them Gallery - editAllow work Sometime
Vivo - Camera - not work both editAllow and correctOrientation Gallery - not work both editAllow and correctOrientation
Code -
OpenCamera() { const options: CameraOptions = { correctOrientation : true, quality: 50, destinationType: this.camera.DestinationType.DATA_URL, encodingType: this.camera.EncodingType.JPEG, mediaType: this.camera.MediaType.PICTURE, allowEdit:true } this.camera.getPicture(options).then((imageData) => { this.profImage = imageData;
let data = { 'photo': this.profImage }; this.upload(data); }, (err) => { // Handle error console.log(err); }); }
OpenGallery() { const options: CameraOptions = { correctOrientation : true, quality: 50, destinationType: this.camera.DestinationType.DATA_URL, encodingType: this.camera.EncodingType.JPEG, mediaType: this.camera.MediaType.PICTURE, sourceType : this.camera.PictureSourceType.PHOTOLIBRARY, allowEdit:true } this.camera.getPicture(options).then((imageData) => { this.profImage = imageData;
let data = { 'photo': this.profImage }; this.upload(data);
}, (err) => { // Handle error console.log(err); }); }
Version information
ionic (Ionic CLI) : 4.10.3 cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1) @ionic-native/camera": "^4.20.0"