@mous12 wrote:
Hi, I am using ionic 3 camera preview plugin. I tried to pass different options to CameraPreviewOptions but there is a reduction of size and quality after taking a picture. When I try to upload, the image get uploaded with size less than 1mb while it should actually be 5mb+ (a usual photo size taken by my phone).
Here is my client code:
openCamera(){ const cameraPreviewOpts: CameraPreviewOptions = { x: 0, y: 0, width: window.screen.width, height: window.screen.height, camera: 'rear', tapPhoto: true, previewDrag: true, toBack: true, tapToFocus: true, alpha: 1 }; // start camera this.cameraPreview.startCamera(cameraPreviewOpts).(res) => { this.isCameraReady = true; }); } takePicture(){ const pictureOpts: CameraPreviewPictureOptions = { quality: 100, }; this.cameraPreview.takePicture(pictureOpts).then((ImageData)=>{ let pic = 'data:image/jpeg;base64,' + ImageData; this.upload(pic); }); }Setting the width and height inside pictureOpts didn’t help either.
Posts: 1
Participants: 1