0

I need to crop image, to square. I use that function:

private void crop(Uri imageUri) {
    File photoGallery = new File(Environment.getExternalStorageDirectory(), "temp_image.jpg");
    checkImageSize(photoGallery);
    Intent cropIntentGallery = new Intent("com.android.camera.action.CROP");
    cropIntentGallery.setDataAndType(imageUri, "image/*");
    cropIntentGallery.putExtra("crop", true);
    cropIntentGallery.putExtra("aspectX", 1);
    cropIntentGallery.putExtra("aspectY", 1);
    cropIntentGallery.putExtra("outputX", PHOTO_SIZE);
    cropIntentGallery.putExtra("outputY", PHOTO_SIZE);
    cropIntentGallery.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoGallery));
    startActivityForResult(cropIntentGallery, REQ_EDIT_CAMERA);
}

And it opens crop activity, but I can change X and Y size. What I need is to fix smallest dimension, so if image was made in landscape mode - user will be able to cut left or/and right edges, if in portrait - top or/and bottom edges. Is there are some extra parameter to do this?

BTW, where I can find list of all possible intent extras? (like: "aspectX", "outputX"...)

4

0 回答 0