So I played with this on (iOS only) because I want to get square photos, not rectangular photos, and this is what I experienced.
SETUP 1
options: CameraOptions = { quality: 40, allowEdit: false, // OR unset as to allow default 'false' cameraDirection: 1, // BACK: 0 FRONT: 1 destinationType: this.camera.DestinationType.DATA_URL, encodingType: this.camera.EncodingType.JPEG, mediaType: this.camera.MediaType.PICTURE, targetHeight: 200, targetWidth: 200 }
SETUP 2
options: CameraOptions = { quality: 40, allowEdit: true, cameraDirection: 1, // BACK: 0 FRONT: 1 destinationType: this.camera.DestinationType.DATA_URL, encodingType: this.camera.EncodingType.JPEG, mediaType: this.camera.MediaType.PICTURE, targetHeight: 200, targetWidth: 200 }
Option 1 returned rectangular photographs while maintaining a normal aspect ratio and one of the sides set (essentially) with "targetHeight" or "targetWidth" acting as max-height or max-width.
DOCS: take a photo and return thumbnails (resize image)
To get smaller images, you can return the resized image by passing the targetHeight and targetWidth values โโwith your CameraOptions object. In this example, you resize the returned image to fit 100 per 100 pixels (aspect ratio is maintained, so 100 pixels is either height or width, whichever is larger in the source) .
When setting 2, the photo looks as usual, and then after shooting, when you get the accept or re-option, a yellow frame appears with the dimensions indicated in the center of the photo, thus showing your crop after it is approved by the user. Thus, the difference between imports is that initially it does not take a square photograph, but returns it.
PLEASE PAY ATTENTION SETUP 2 MAY NOT WORK ON Android
allowEdit is unpredictable on Android and should not be used! The implementation of this plugin in Android is trying to find and use the application on the user device to crop the image. The plugin does not control which application the user selects to perform image cropping, and it is quite possible that the user could select an incompatible option and cause the plugin to fail. Sometimes this works because most devices come with an application that handles cropping in a way compatible with this plugin (Google Plus Photos), but you should not rely on it. If image editing is important for your application, consider looking for a third-party library or plug-in that provides its own image editing utility for a more robust solution.