Deleting Thumbnails

The deletion of a thumbnail is somehow tricky. A general rule is that a thumbnail should be deleted if the orginial file doesn't exist anymore (Note: If it was only modified the thumbnail should be recreated instead). There are different ways how this can be achieved:

  1. If a filemanger is aware of this standard and deletes a file it could take care of deleting the thumbnail too.

  2. A daemon runs in the background which cleans up the cache in certain intervalls.

  3. The user can call a managing tool which lists all the thumbnails together with their original file paths. From there he can delete single images, all images where the orignial doesn't exist anymore or all images older than eg. 30 days.

The problem is that there are some URI schemes where it isn't directly possible to determine if the file exists or not. Eg. this applies to all the internet related schemes like http:, ftp: and so on when you don't have an internet connection. The same applies to removable media eg. a cdrom which will be mounted at /cdrom.

The above mentioned managing programs should therefore consider the following rules:

  1. If the URI scheme specifies a local file (like the file: scheme) then it should check if the original file exists. If it doesn't exist anymore the program should delete the thumbnail.

  2. For all internet related schemes (like http: or ftp:) delete the thumbnail if it hasn't been accessed within a certain user defined time period (can default to 30 days).

  3. Removable media should be considered too by checking the mount location for them in the fstab configuration file. Thumbnails for files in these directories should be handled as in the previous point.