Q) Is there a way to force the aspect ratio of the camera via the Cordova plugin?
Details:
I'm using the Cordova camera plugin to take a photo.
I am trying to force the resolution of 1366 x 768.
The issue is that the supplied parameters for width and height
seem to not have any effect unless the camera ratio is first set up using the settings in the camera app itself on the device.
I.e. if the device is set up for 4:3 photos, then no matter what I do in the options, the photos are always 4:3.
Here's the code I'm currently using:
Camera.getPicture({
sourceType: 1,
destinationType: 0,
encodingType: 0,
saveToPhotoAlbum: false,
allowEdit: false,
quality: 75,
correctOrientation: true,
targetWidth: 1366,
targetHeight: 768
}).then((imageBase64: string) => {
resolve('data:image/jpeg;base64,' + imageBase64);
}, (error) => {
resolve(null);
});