Bug 496072

Summary: Dolphin overwrites correct and already existing thumbnails with invalid and wrong ones.
Product: [Applications] dolphin Reporter: navid.zamani+kde
Component: view-engine: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: kde, kfm-devel
Priority: NOR    
Version: 24.08.2   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description navid.zamani+kde 2024-11-11 02:16:24 UTC
[I don’t know if this is part of Dolphin or some other “framework” thing, so I had to choose Dolphin, as that is where it appeared. Please feel free to move it to the correct product/component, if that is wrong.]

SUMMARY
It seems, KDE offers no way to drop/hook one’s own thumbnailing scripts anywhere, so I had to write my own scanner/generator, based on the official spec: https://specifications.freedesktop.org/thumbnail-spec/latest/thumbsave.html

But instead of using them, Dolphin just overwrites them with its own, using the wrong sizes too. (According to above spec, normal is 128x128. But dolphin uses 160px and 320px width for large and x-large.)

Even when I make my own thumbnails read-only, Dolphin simply ignores them.

If Dolphin was a human, I would describe that as literally hostile.


STEPS TO REPRODUCE
0. Open Dolphin in video directory $x, make sure you are in icon view with previews, choose the largest size with the slider. If necessary, press F5 to refresh.
1. Clear the thumbnails with `rm -rf .cache/thumbnails/*/*`, or move them somewhere else.
2. Generate your own thumbnails for e.g. your video directory $x, in the correct format, and store them correctly, in accordance to above spec. (Correct subdir; correct file name from correct hash from correct URI from file name; correct image size, correct file format. All of which I have verified multiple times for my code. The resulting files are just of higher quality and a different size (due to different content) than the ones Dolphin generates.)
3. Use `ls -lahvF ~/.cache/thumbnails/*/` and `file ~/.cache/thumbnails/*/*` to list the thumbnails.
4. In Dolphin, press F5 to refresh.
5. Use `ls -lahvF ~/.cache/thumbnails/*/` and `file ~/.cache/thumbnails/*/*` to list the thumbnails again.

OBSERVED RESULT
In step 4, the Video preview pictures flash, and stay as the ones Dolphin generated.
In step 5, the file metadata (file size, image size, creation time, …) visibly changed.
Your self-generated thumbnails are gone.

EXPECTED RESULT
There should of course be a simple directory to put one’s thumbnailers in (e.g. like in Cinnamon/Gnome). Or at least a way to add a hook for one’s own scripts.
In lack of that, Dolphin should of course not overwrite already existing good thumbnails. Let alone with weird non-standard sizes.

SOFTWARE/OS VERSIONS
Operating System: Gentoo Linux (profile: default/linux/amd64/23.0/desktop/plasma; last (full) update on: 2024-11-07) 
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.7.0
Qt Version: 6.7.3
Comment 1 David Edmundson 2024-11-11 16:50:44 UTC
>There should of course be a simple directory to put one’s thumbnailers in (e.g. like in Cinnamon/Gnome). 

We do support that specification since the last few releases. For that reason I'll mark this as closed.

As for manually writing to the cache, KDE code has a check to see if we have a thumbnailer enabled for that format, if so it will compare additional metadata to see if KDE's thumbnailer is newer than when it was last generated, if it is not present it is re-generated. This is by design as we get a lot of other reports about outdated caches.