I am trying to use Biokys crop Image and it says you need pass it a file path of an image.
I have a URI that I'm passing to it:
intent = getActivity().getIntent();
uri = intent.getParcelableExtra("Image");
Intent intent = new Intent(getActivity(), CropImage.class);
intent.putExtra(CropImage.IMAGE_PATH, uri.getPath());
intent.putExtra(CropImage.SCALE, true);
intent.putExtra(CropImage.ASPECT_X, 3);
intent.putExtra(CropImage.ASPECT_Y, 2);
startActivityForResult(intent, REQUEST_CODE_CROP_IMAGE);
Here is the onActivityResult:
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode != getActivity().RESULT_OK) {
return;
}
Bitmap bitmap;
switch (requestCode) {
case REQUEST_CODE_CROP_IMAGE:
String path = data.getStringExtra(CropImage.IMAGE_PATH);
if (path == null) {
return;
}
Picasso.with(getActivity()).load(path).into(mImageView);
break;
}
super.onActivityResult(requestCode, resultCode, data);
}
But when I try to pass my Uri to the crop class I get the following in my Logcat:
file /external/images/media/39690 not found
Would anyone know what I can do to get it to read my Uri? thanks