2

I have the below crop method. When I call cropIntent.putExtra(MediaStore.EXTRA_OUTPUT, uri); my screen hangs at 'saving image'. If I don't call it, the cropped image is not written to file.

private void crop() {
try {
    Intent cropIntent = new Intent("com.android.camera.action.CROP");

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

    cropIntent.putExtra("crop", "true");
     cropIntent.putExtra("aspectX", 4);
    cropIntent.putExtra("aspectY", 3);
     cropIntent.putExtra("outputX", 500);
    cropIntent.putExtra("outputY", 300);
    File f = new File(Environment.getExternalStorageDirectory(),
            "/temporary_holder.jpg");
    try {
        f.createNewFile();
    } catch (IOException ex) {
        Log.e("io", ex.getMessage());
    }
    uri = Uri.fromFile(f);
    cropIntent.putExtra(MediaStore.EXTRA_OUTPUT, uri);

    startActivityForResult(cropIntent, PIC_CROP);

} // respond to users whose devices do not support the crop action
catch (ActivityNotFoundException anfe) {
    // display an error message
    String errorMessage = "Your device doesn't support the crop action!";
    Toast toast = Toast
            .makeText(this, errorMessage, Toast.LENGTH_SHORT);
    toast.show();
}

}
Esoteric Screen Name
  • 6,082
  • 4
  • 29
  • 38
user903772
  • 1,554
  • 5
  • 32
  • 55

1 Answers1

0

I have the same problem, it stucks with: cropIntent.putExtra("outputX", 500); .. so badly that the only way to repair this is to remove the batterie..

but if I take cropIntent.putExtra("outputX", 200); it works fine..

(device HTC Sensation Z710e Android 4.0.3 (API 15))

brainwave
  • 1
  • 1