How to Crop Images?


#1

Hi , i use the cordova to get image from photo album

var option = {
                targetWidth: 600,
                targetHeight: 400,
                quality: 50,
                destinationType: Camera.DestinationType.DATA_URL,
                sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
                allowEdit: true,
                encodingType: Camera.EncodingType.JPEG,
                mediaType: Camera.MediaType.ALLMEDIA,
                saveToPhotoAlbum: false
            };
navigator.camera.getPicture(cameraSuccess, cameraError, option);

but the return image not crop to 600 * 400

How to crop image to 600*400?

Thank you


#2

Camera plugin maintains aspect ratio, so are you sure that source image has same aspect ratio as destination which you set.