Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop images on sd card from showing up in gallery?

Tags:

android

I keep some png files on the user's sd card. Some users report that these images are showing up in their gallery application. Sounds like the gallery implementation on some devices search out any image files they can find on the sd card and show it in the gallery. Is there a way to tell the system not to include these images in the gallery? It's just an annoyance to the users.

Thanks

like image 380
user291701 Avatar asked Apr 18 '11 18:04

user291701


People also ask

How do I stop photos from showing in gallery?

This time, start by heading to Settings > Biometrics and security > Content Lock. The phone will ask you to secure the feature using a PIN, password, or fingerprint scan. Now go to your phone's default gallery app. Select all the photos you want to hide and tap Menu > More > Lock.

Does gallery show SD card photos?

If the SD card files are not showing up in Gallery on your Android phone but appear on your computer, your memory card may have a file system that your mobile is incompatible with. Android doesn't support NTFS file system. Instead, it is fully compatible with FAT32, Ext3, and Ext4 file system.


1 Answers

You can hide individual files from the gallery with a . prefix. For example .myimage.png

I'm not sure what version dependencies the above has and it doesn`t work with some third-party picture tools like the Gallery.

You should add a file named .nomedia into the directory where your images are. You may need to eject and re-insert the SD card before the images disappear from gallery (or otherwise trigger the media scanner) after creating this file on a phone that the Gallery has already picked up the files in the Gallery.

I think the .nomedia option is the best solution, although again, third party tools may not respect the .nomedia flag.

like image 172
tamarintech Avatar answered Sep 28 '22 08:09

tamarintech