Image quality degrades after cropping

I am collecting an image using camera intent and sending it to the server. But the problem is when I crop this image, its quality is greatly reduced. It looks strange. I am using Samsung Note 2 for testing, but the image quality is too poor after cropping. Can anyone share some good cropping code that doesn't degrade its quality? This is my current code for cropping an image.

public void performCrop(Uri picUri) {
    try {
        Intent cropIntent = new Intent("com.android.camera.action.CROP");
        cropIntent.setDataAndType(picUri, "image/* ");
        cropIntent.putExtra("crop", "true");
        cropIntent.putExtra("aspectX", 1);
        cropIntent.putExtra("aspectY", 1);
        cropIntent.putExtra("outputX", 200);
        cropIntent.putExtra("outputY", 200);
        cropIntent.putExtra("return-data", true);
        startActivityForResult(cropIntent, PIC_CROP);
    } catch (ActivityNotFoundException anfe) {

        String errorMessage = "Whoops - your device doesn't support the crop action!";
        toast(errorMessage);
    }

}

      

Thanks in advance.

+3


source to share





All Articles