Ionic cordova iOS ignores targetHeight

138 Views Asked by At

I am using the Cordova camera plugin with Ionic on an iPhone (iOS). I try to limit the size of the image stored by adding the targetHeight option. This works on Android by setting the max height to the targetHeight option. On iOS, this is option is ignored and I get an unchanged, large image.

CameraOptions = {
  quality: 50,
  destinationType: this.camera.DestinationType.DATA_URL,
  encodingType: this.camera.EncodingType.JPEG,
  mediaType: this.camera.MediaType.PICTURE,
  targetHeight: 1080,
  correctOrientation: true,
};

Thanks in advance for any help with this.

1

There are 1 best solutions below

0
MichaelG On BEST ANSWER

The problem was that the plugin requires a targetHeight and a targetWidth.