Bug 496072 - Dolphin overwrites correct and already existing thumbnails with invalid and wrong ones.
Summary: Dolphin overwrites correct and already existing thumbnails with invalid and w...
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: view-engine: general (show other bugs)
Version: 24.08.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-11 02:16 UTC by navid.zamani+kde
Modified: 2024-11-11 16:50 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.