The current behavior is as in the title, when I send image either from Gallery and Camera, it works at first. Then for the subsequent cropping it doesn't work.
By doesn't work, I mean, Image Uri taken from UCrop.getOutput(result); gives the same Uri as the first image.
What I did is :
Uri compressedUri = Utilities.compressImage(this, uri);
Date date = calendar.getTime();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("ddMMyyyyHHmmss", Locale.US);
String dateString = simpleDateFormat.format(date);
imageName = dateString + ".jpg";
UCrop uCrop = UCrop.of(compressedUri, Uri.fromFile(new File(getCacheDir(), imageName)));
UCrop.Options uCropOption = new UCrop.Options();
uCropOption.setToolbarColor(ContextCompat.getColor(this, R.color.miBlue));
uCropOption.setStatusBarColor(ContextCompat.getColor(this, R.color.miBlack));
uCropOption.setToolbarTitle(this.getString(R.string.cropTitle));
uCrop.withOptions(uCropOption);
uCrop.start(this);
imageRealPath shows it has the correct Uri (even if I use capturedImageUri.getPath)
Then at startCropActivity()
Uri compressedUri = Utilities.compressImage(this, uri);
Date date = calendar.getTime();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("ddMMyyyyHHmmss", Locale.US);
String dateString = simpleDateFormat.format(date);
imageName = dateString + ".jpg";
UCrop uCrop = UCrop.of(compressedUri, Uri.fromFile(new File(getCacheDir(), imageName)));
UCrop.Options uCropOption = new UCrop.Options();
uCropOption.setToolbarColor(ContextCompat.getColor(this, R.color.miBlue));
uCropOption.setStatusBarColor(ContextCompat.getColor(this, R.color.miBlack));
uCropOption.setToolbarTitle(this.getString(R.string.cropTitle));
uCrop.withOptions(uCropOption);
uCrop.start(this);
The current behavior is as in the title, when I send image either from Gallery and Camera, it works at first. Then for the subsequent cropping it doesn't work.
By doesn't work, I mean, Image Uri taken from
UCrop.getOutput(result);
gives the same Uri as the first image.What I did is :
imageRealPath
shows it has the correct Uri (even if I use capturedImageUri.getPath)Then at startCropActivity()
In
handleCropResult()
Current version I am using is 2.2.0 of Ucrop, and it didn't work either in 2.1.2