从显示在画廊上停止在SD卡上的图像?画廊、卡上、图像、SD

2023-09-05 10:23:02 作者:爱打盹的猫

我把用户的SD卡上的某些PNG文件。一些用户报告说,这些图像显示了他们自己的相册应用起来。听起来像画廊执行某些设备上搜索出任何图像文件,他们可以找到SD卡上,并显示在画廊。有没有办法告诉系统不包括库中的这些图片?这只是一个烦恼的用户。

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.

感谢

推荐答案

您可以从与画廊隐藏个人文件的 preFIX。例如 .myimage.png

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.

您应该添加一个名为 .nomedia 到,你的图像目录文件。您可能需要退出并重新插入SD卡前,从库中的图像消失(或以其它方式引发媒体扫描仪)在手机上创建该文件,该库已经拿起文件在画廊后。

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.

我觉得 .nomedia 选择是最好的解决方案,虽然再次,第三方工具可能不尊重 .nomedia 标记。

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