Camera plugin - How to control image size


#1

I am using the camera plugin with the options below to capture images and then I save them in Firebase storage. The size for each image is approximately 1.2 MB, which is too big.

My question is, if I change the quality parameter to 50, for example, would that allow me to save an image with half the quality and half the size? Maybe?

takePhoto() {

    let cameraOptions : CameraOptions = {
        sourceType: this.camera.PictureSourceType.CAMERA,
        destinationType: this.camera.DestinationType.DATA_URL,
        quality: 100,
        targetWidth: 800,
        targetHeight: 800,
        encodingType: this.camera.EncodingType.PNG,
        correctOrientation: true
    };
    this.camera.getPicture(cameraOptions).then((imageData) => {
      this.saveThisPic = imageData;
      this.displayThisPic = "data:image/jpeg;base64," + imageData;
    }, (err) => {
      console.log(err);
    });
  }