Clean-up KDE Thumbnails
KDE creates thumbnails of all your files when you view them in Dolphin or Konqueror. It then saves these thumbnails so that if you look at the photo again it doesn’t have to regenerate the thumbnail. This is a really efficient way of doing things. Plus, it stores the thumbnails in a central place instead of, like Windows, leaving little Thumbs.db
files around the place. The drawback with the current system is that if you delete a photo then its thumbnail is not deleted along with it. This means that if you simply rename a folder then a huge swathe of saved thumbnails will no longer refer to the correct files - thus being useless. After a while these accumulate and occupy disk space when they really shouldn’t.
Version 2
This version is completely unrelated to the first one - it is simply a BASH script that relies on exiftool to do the inspection of the PNG meta-data. This is the one that I run regularly on my Linux boxes. I will leave the old version here too for archival.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
|
checkout
the “main” branch).Version 1
To quote the comment in the script:
This script will: search for all the saved thumbnails on your KDE system; then check if the original file is present and delete the thumbnail if it is not; or delete the thumbnail if it references the trash can.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
checkout
the “main” branch).I hope this script is useful for you. The first time I ran it it removed 90 MBs of redundant thumbnails for me!