-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera blank image is not deleted ! #309
Comments
Not sure if this is helpful but I fixed it by changing /**
* Check if the captured image is stored successfully
* Then reload data
*/
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RC_CAPTURE) {
if (resultCode == RESULT_OK) {
presenter.finishCaptureImage(getActivity(), data, getBaseConfig());
} else if (resultCode == RESULT_CANCELED && isCameraOnly) {
presenter.abortCaptureImage();
interactionListener.cancel();
}
}
} to } else if (resultCode == RESULT_CANCELED) { //removed isCameraOnly to get next part to tigger
presenter.abortCaptureImage(getContext()); and in val imagePath = currentImagePath ?: return
val file = File(imagePath)
if (file.exists()) {
file.delete()
} else { //Added this else part since in api29+ we use mediastore we need to remove the canceled row from there.
val uri = Uri.parse(currentUri)
context.applicationContext.contentResolver.delete(uri, null, null)
} @esafirm if this is not helpful at all, just delete it, i have not tested this much just trying some quick and dirty changes to get the lib working in api29 and 30 targeting 30 for personal use. |
Got it @Nightfright will try to include this on 3.x |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I open camera, a blank image is created and is not deleted after I get back from camera !
Steps to Reproduce the Problem
1.open camera
2. go back or close App
3. the blank 0kb image is not removed from storage !
Specifications
The text was updated successfully, but these errors were encountered: