Bug 432890 - wrong thumbnails for tag-related search results
Summary: wrong thumbnails for tag-related search results
Status: RESOLVED FIXED
Alias: None
Product: baloo-widgets
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 19.12.0
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Stefan Brüns
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-13 13:56 UTC by datenplage
Modified: 2021-03-24 19:41 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Tag-list (246.21 KB, image/png)
2021-02-13 13:56 UTC, datenplage
Details

Note You need to log in before you can comment on or make changes to this bug.
Description datenplage 2021-02-13 13:56:53 UTC
Created attachment 135659 [details]
Tag-list

SUMMARY


STEPS TO REPRODUCE
1. use in dolphin under places the "tag"-section
2. select tag

OBSERVED RESULT
for different files it shows the same thumbnail in a row. open theses images with default image-viewer it shows the right file. it seems to be an error in resetting a counter in a loop-creation: sometimes the first 10 files have the same thumbnail, then the next 7 files and so on. after cache-deletion it creates in same individual sequence for each folder.

EXPECTED RESULT
each file different thumbnail

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 20.04
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8

ADDITIONAL INFORMATION
Comment 1 Stefan Brüns 2021-02-16 17:14:14 UTC
Fixed in 5.75
Comment 2 tagwerk19 2021-02-16 17:20:09 UTC
Maybe correlated?

Create two images, say "one.jpg" and "two.jpg", under Pictures. Open folder in Dolphin

Rename "two.jpg" to "twox.jpg":

    The file is renamed, the thumbnail remains "as is"

Rename "one.jpg" to "two.jpg":

    The file is renamed, the thumbnail changes to that of the "earlier" two.jpg

If this is a distinct issue, I'll create a new bug report.

    Neon Testing
    Plasma : 5.21.0
    Frameworks : 5.79.0
    Qt : 5.15.2
Comment 3 datenplage 2021-02-18 21:07:07 UTC
(In reply to Stefan Brüns from comment #1)
> Fixed in 5.75

can u give me the link of this fix?
Comment 4 tagwerk19 2021-02-19 12:58:01 UTC
For completeness, the issue when renaming files (comment 2) occurred when the files had the same modification time.
Comment 5 Stefan Brüns 2021-02-19 13:49:17 UTC
(In reply to tagwerk19 from comment #4)
> For completeness, the issue when renaming files (comment 2) occurred when
> the files had the same modification time.

As far as the thumbnail specification goes this is undetectable then. A file is considered unchanged if the mtime for a URL stays the same:

https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-0.8.0.html#MODIFICATIONS

For renames/deletes using KIO (e.g. dolphin) this could be handled better, but thats an KIO issue then, not baloo.
Comment 6 tagwerk19 2021-02-19 16:46:03 UTC
(In reply to Stefan Brüns from comment #5)

> As far as the thumbnail specification goes this is undetectable then. A file
> is considered unchanged if the mtime for a URL stays the same:
Hmmm. I think the example code is going to miss cases.

I was just copying files but I can imagine a scenario of a batch update of image metadata could leave many files with the same modification time.

I've posted a suggestion

    https://gitlab.freedesktop.org/xdg/xdg-specs/-/issues/72

to suggest comparing the size (if it noted in the thumbnail PNG) in addition to the modification time.
Comment 7 datenplage 2021-03-24 17:58:31 UTC
(In reply to tagwerk19 from comment #4)
> For completeness, the issue when renaming files (comment 2) occurred when
> the files had the same modification time.

copy that
Comment 8 tagwerk19 2021-03-24 19:41:09 UTC
There was a fix done for 5.80.0, see:
    https://bugs.kde.org/show_bug.cgi?id=433127#c9
Which sorted out my particular issue.