-1

I tried below code to crop large image with pixel (2448*3264). But, This process is not working fine. Please correct the below code or give me another solution to achieve this images cropping process. Advance thanks to all.

private void performCrop(){
    try {

        Intent cropIntent = new Intent("com.android.camera.action.CROP"); 

        cropIntent.setDataAndType(UrlGambar, "image/*");

        cropIntent.putExtra("crop", "true");

        cropIntent.putExtra("aspectX", 2);
        cropIntent.putExtra("aspectY", 3);

        //cropIntent.putExtra("outputX", 256);
        //cropIntent.putExtra("outputY", 256);

        cropIntent.putExtra("return-data", true);

        startActivityForResult(cropIntent, PIC_CROP);
    }
    catch(ActivityNotFoundException anfe){

        String errorMessage = "Whoops - your device doesn't support the crop action!";
        Toast toast = Toast.makeText(this, errorMessage, Toast.LENGTH_SHORT);
        toast.show();
    }
  }
}
iffu
  • 331
  • 1
  • 4
  • 16
arfanHa
  • 1
  • 2

1 Answers1

1

Intent com.android.camera.action.CROP is not a standard android intent and there are many devices that donot support this intent. Please refer to my answer in this post. I am using a library from github to do the cropping.

Community
  • 1
  • 1
Illegal Argument
  • 10,090
  • 2
  • 44
  • 61