Completely disabling file and folder thumbnail generation

Hi, so, I have a bit of a problem or maybe brainstorming topic.

The short story: for various reasons I want to be able to stop thumbnails from being generated. Search results suggest that disabling “previews” in dolphin should be the solution, but the reality is that ~/.cache/thumbnails/ still gets populated and I can’t seem to find a way to configure this any other way. (On Plasma 6.5.4)

Now for the long story:

I don’t actually want to completely get rid of thumbnails, but I work a lot with large folder structures containing images. And by large, I mean huge, think multiple thousand folders each containing images in one parent folder (the worst offender sits at about 15000 sub folders at the moment). Since these folders also take up a lot of space and the main purpose is archiving, they’re stored on a rather slow, NAS grade hard drive (WD Red).

By now it is probably not hard to imagine that working in these folders can be a bit sluggish (although dolphin does do a pretty decent job once everything’s been loaded from disk), and, getting to the core of the problem, it gets worse when kioworker decides it is thumbnailing time, which it does quite often when opening one of those folders. So the IO performance tanks even harder as multiple kioworker processes start crawling through thousands of folders, looking for image files to create folder thumbnails from, which I won’t ever see because I got them disabled. So loading the file list in dolphin can sometimes take like a minute while the IO processes fight over who gets priority.

Of course, this would also generate gigabytes of thumbnails (and write cycles) on my main SSD, which I have mitigated by mounting ~/.cache/thumbnails onto a ram disk. And then, to keep my RAM from filling up, I had to create a cron task for cleaning out the thumbnail folders periodically. But, since thumbnails keep getting deleted, kioworker goes back to recreating them in a beautiful vicious cycle.

For now I’d be happy for any suggestions to help with my specific problem. For instance, thumbnails won’t be generated for FUSE mounts, but I’m not sure if there is a way of mounting a local hard drive through FUSE and what repercussions this might have. Moving the image archives to an actual network storage is financially not viable at the moment.

And then, back to the brainstorming part, here’s my wish list of how I would like to configure thumbnail generation in order of preference:

  • Having a way to configure thumbnail generation per path, this could be including all bells and whistles (basically the current dolphin “preview settings” on a per-folder basis)
  • Being able to exclude specific paths from either folder or file thumbnail generation, so for instance in ~/image-archives/ I only want thumbnails for files in folders I actually open, no generation of folder thumbnails, but everywhere else I’d be okay with folder thumbnails as well
  • Being able to exclude paths just in general, not ideal, but probably easy to implement
  • At least being able to keep kioworker from generating thumbnails in general

As an aside, since thumbnails are not only used for dolphin (which I guess might be the reason why disabling them in dolphin’s settings won’t actually stop them from being created), I’d actually suggest creating a new “thumbnails” page in System Settings for these sorts of configurations.

This is a very good issue, I know in my case I assumed that ‘thumbnails” are the purview of Dolphin, so I found in its Settings → “Configure Dolphin“ → Interface → “Previews” tab I could just uncheck all the filetypes to stop “showing” them. But that’s unclear if that prevents actually generating all the TNail files (I hope so) too. I set the “local storage” for “files below 1MB” and “remote storage” to “no file”. So that would seem to me to be as restrictive as I can go.

It would be nice to have a:

“Don’t have thumbnails at all, not shown nor the files created”

type of setting so we can unambigiously stop both creating the TNail files and showing them

Hey, thanks for the reply.
First of, I have to admit something: ever since making this thread I have not actually been able to observe the problems with kioworker going berserk anymore. So, either some updates I installed previously actually already solved these issues or I’m just going crazy myself, but I swear it still happened some time last week.
I’m still finding thumbnail files being created now and then, but those probably aren’t getting created through dolphin anymore but rather through some other applications.

Which brings me to my next point: after thinking about the whole situation a bit more I realized my “system settings” suggestion probably won’t work, or at least not in the way I want it too.
I just assumed all thumbnails probably went through kioworker in some way, and maybe this is at least the case for KDE applications, but in reality every application is “allowed” to create thumbnails on its own accord. So a global thumbnail configuration page probably is not feasible the way I imagined it, as long as Plasma doesn’t offer a general API which all other applications will support.

But maybe someone who actually understands how all these mechanisms work together can shed some more light.

Having more options for configuration where it is possible would still be great.

If thumbnails for folders are disabled in Dolphin settings, I would not expect any of Dolphin-related processes to visit child directories of the one I’m currently in. If thumbnails for directories are enabled, I would expect Dolphin to go 1 level deeper, not more. Is it not the case? If this is how it works, you shouldn’t have had any problems while browsing your file system.

Being able to specify “exclude paths” in some configuration file to prevent Dolphin from creating thumbnails for these directories recursive will be very useful. I even suspect something of this kind already exist in Dolphin codebase, I’ve seen someone was complaining Dolphin is creating thumbnails when he visits ~/.cache/thumbnails/ directories, and then Dolphin creates thumbnails for thumbnails etc. So, default entry in “exclude paths” would be ~/.cache/thumbnails/.

“Exclude sizes” also would be nice. Are these all possible - large normal x-large xx-large? Marking them all as excluded would’ve effectively disable thumbnail generation. Or maybe “minSize” and “maxSize”.