Summary: | Dolphin thumbnail confusions | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | tagwerk19 |
Component: | general | Assignee: | Dolphin Bug Assignee <dolphin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | katyaberezyaka, kfm-devel, meven29, nate |
Priority: | NOR | ||
Version: | 20.12.2 | ||
Target Milestone: | --- | ||
Platform: | Neon | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=432890 | ||
Latest Commit: | https://invent.kde.org/frameworks/kio/commit/b33307901f30ec8d724a7e424838165746563d06 | Version Fixed In: | 5.80 |
Sentry Crash Report: |
Description
tagwerk19
2021-02-17 23:08:50 UTC
Files names are what it used as keys in the thumbnail cache. If we want to solve this either we use other kind of keys like a hash of inode id / device id combination or we implement a special case in dolphin when renaming files, but that is tricky, or we implement some cache invalidation when files are moved / deleted. (In reply to Méven Car from comment #1) > Files names are what it used as keys in the thumbnail cache. Ouch... > ... like a hash of inode id / device id combination ... Maybe the source node id can be held in a thumbnail xattr (and, if present, used for cross checking) > ... or we implement some cache invalidation when files are moved / deleted. Or maybe "when it is noticed". It would definitely be nice if refreshing the panel sorted the thumbnails. Isn't this stuff governed by a FreeDesktop.org spec? If there's an issue with the thumbnail keys, it might need to be fixed in the spec first. https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html Which talks about attributes in the PNG file: a couple being required: Thumb::URI Thumb::MTime plus some additional, including Thumb::Size If I poke around in my thumbnail PNG's, I see that these are being used. They would be enough to catch the issue I was having. The spec also leaves open the option of further 'X-' prefixed attributes. There's a section covering detecting modifications: https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html#MODIFICATIONS If I delete all the thumbnail PNGs, touch one of the source images and rerun the test, the thumbnails work as they should. If dolphin is checking the filename and modification time, that's not enough for my case. It also proved not enough for the test scenario (which is of course simplified!). Add in a check of the file size, and it would have been OK. Posted a suggestion: https://gitlab.freedesktop.org/xdg/xdg-specs/-/issues/72 to suggest comparing the file size (in the cases it exists in the PNG metadata) as well as the modification time. A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/350 This (In reply to tagwerk19 from comment #6) > Posted a suggestion: > > https://gitlab.freedesktop.org/xdg/xdg-specs/-/issues/72 > > to suggest comparing the file size (in the cases it exists in the PNG > metadata) as well as the modification time. I would encourage you to fill a MR yourself, no coding involved, you can do it from the browser. https://gitlab.freedesktop.org/xdg/xdg-specs/-/blob/master/thumbnail/thumbnail-spec.sgml In any case KIO does support time modification check but with a *second* precision meaning this bug can only happen when the two files share the same modification time modulo one second. This will add file size to the cache validation check https://invent.kde.org/frameworks/kio/-/merge_requests/350 Git commit b33307901f30ec8d724a7e424838165746563d06 by David Faure, on behalf of Méven Car. Committed on 20/02/2021 at 11:40. Pushed by dfaure into branch 'master'. PreviewJob: consider file size for cache invalidation M +2 -1 src/widgets/previewjob.cpp https://invent.kde.org/frameworks/kio/commit/b33307901f30ec8d724a7e424838165746563d06 (In reply to Méven Car from comment #8) > ... I would encourage you to fill a MR yourself, no coding involved ... Every day a learning day, how about https://gitlab.freedesktop.org/xdg/xdg-specs/-/merge_requests/42 Yes, able to swap two files (that have the same timestamp) filenames. That works, many thanks! With Neon Testing Plasma : 5.21.1 Frameworks : 5.80.0 Qt : 5.15.2 |