Skip to content
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

Gallery shows deleted files #171

Closed
deputat007 opened this issue Oct 9, 2018 · 6 comments
Closed

Gallery shows deleted files #171

deputat007 opened this issue Oct 9, 2018 · 6 comments

Comments

@deputat007
Copy link

deputat007 commented Oct 9, 2018

Please check in ImageFileLoader if file exists
if (file != null && file.exists()) { if (exlucedImages != null && exlucedImages.contains(file)) { continue; }

@esafirm
Copy link
Owner

esafirm commented Oct 9, 2018

Hmm interesting, have you tried triggering the media scanner after you delete the file?

@deputat007
Copy link
Author

Hmm interesting, have you tried triggering the media scanner after you delete the file?

No, I just removed photo in gallery and noticed that it is still visible in ImagePickerActivity.

Please check in ImageFileLoader if file exists
if (file != null && file.exists()) { if (exlucedImages != null && exlucedImages.contains(file)) { continue; }
This will help to fix this bug.

@idish
Copy link
Contributor

idish commented Oct 29, 2018

Just a side note: Checking for each file if it exists via file.exists, makes the loading much slower.
See my accepted PR: #142

@noman720
Copy link

noman720 commented Nov 9, 2019

I'm facing the same problem. In my case, I have to move the captured/gallery image to the apps external directory. After moving some selected images to apps external directory, the ImagePicker shows those images again in the gallery which does not exist.

@RationalRank
Copy link
Contributor

@esafirm @deputat007 I experienced this issue and got to know that the entry in MediaStore wasn't removed and that is the reason it was still shown in the ImagePicker, and also the deleted file was shown in Google Photos app as well. I noticed this case when I deleted the file programmatically (didn't notify MediaStore), but the files which were deleted using Google Photos app or the Google Files app (which implicitly notifies MediaStore) didn't show up in ImagePicker which is the expected scenario.

@esafirm
Copy link
Owner

esafirm commented Jun 20, 2021

Related to #309
Fixed in #370

@esafirm esafirm closed this as completed Jun 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants