Bug 438691

Summary: Desktop Image thumbnails broken with KIO 5.83
Product: [Frameworks and Libraries] frameworks-kio Reporter: Juan Méndez <vpsink>
Component: generalAssignee: KIO Bugs <kio-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: bugseforuns, halftough29a, jajdorkster, kde, kdelibs-bugs, lx.combox, nate, notmart, plasma-bugs, tagwerk19, vmordstein
Priority: VHI Keywords: regression
Version: 5.83.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In: 5.85
Sentry Crash Report:

Description Juan Méndez 2021-06-15 18:58:45 UTC
SUMMARY
Just as the title suggests, desktop image thumbnails seem to be broken on Plasma 5.22.*

STEPS TO REPRODUCE
1. Copy, move, or save an image (PNG, JPG or BMP should be enough) to your Desktop folder. I used Spectacle for this.

OBSERVED RESULT
All the image files will be there, but they won't have any thumbnails. Thumbnails display just fine on Dolphin, though.

EXPECTED RESULT
There should be thumbnails for the recently created/moved/copied images instead of the default icon for images.

SOFTWARE/OS VERSIONS
I was able to replicate this issue in the following *LIVE* environments:
KDE Neon: neon-unstable-20210615-1355.iso
KDE Neon: neon-user-20210614-1203.iso

Also tested on Arch Linux:
plasma-desktop 5.22.1-1
plasma-framework 5.83.0-1

Restarting plasma seems to force whatever the desktop uses to create the MISSING thumbnails. New images won't have their respective thumbnails.
This bug wasn't present in 5.21: Kubuntu's plasma (5.21.4-0ubuntu1) doesn't present this issue.
Comment 1 Nate Graham 2021-06-16 17:17:23 UTC
Can reproduce. If I restart plasmashell, some but not all of the missing thumbnails are displayed, but others are still missing. Saving a new image to the desktop results in it never immediately getting its thumbnail as expected, though.
Comment 2 Juan Méndez 2021-06-16 17:24:24 UTC
(In reply to Nate Graham from comment #1)
> Can reproduce. If I restart plasmashell, some but not all of the missing
> thumbnails are displayed, but others are still missing. Saving a new image
> to the desktop results in it never immediately getting its thumbnail as
> expected, though.

Exactly. I noticed that this is not only affecting image previews, but also font (ttf/otf) and audio (mp3/flac) album art previews. 
I suspect the whole thumbnail backend used in the desktop part of KDE is somehow broken or buggy ATM.
Comment 3 Kai Uwe Broulik 2021-06-19 15:18:56 UTC
Can confirm. At a glance like a regression from e56893b087ef021706ee4623dcadfc495fba528c

It probably thinks desktop:/ is a remote location and/or gets confused in canBeCached by failing to get the parent device ID or whatever. In any case, it does not handle it properly.
Comment 4 Kai Uwe Broulik 2021-06-22 10:11:54 UTC
I wonder if that affects other "local" protocols like filenamesearch or recentlyused, too.
Comment 5 Valter 2021-06-23 14:53:54 UTC
Still here with KDE neon 5.22 with KDE Plasma 5.22.2
Comment 6 Kai Uwe Broulik 2021-06-23 20:04:35 UTC
In Dolphin I also see existing thumbnails randomly disappear as I scroll through the view.. I suggest we revert that commit unless we find a different solution.
Comment 7 Marco Martin 2021-06-25 10:26:41 UTC
commit e56893b087ef021706ee4623dcadfc495fba528c from KIO repository
Comment 8 Juan Méndez 2021-06-26 00:07:17 UTC
Just as a note: You can temporarily fix this issue by installing an older kio version (kio-5.82.0-1 doesn't seem to be affected).
Comment 9 Patrick Silva 2021-07-07 15:12:16 UTC
*** Bug 439568 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2021-07-22 18:14:13 UTC
marcin, could you take a look into this? Thanks!
Comment 11 Nate Graham 2021-08-02 16:54:42 UTC
Git commit 2c01ea964f53aba93afaf22e3e63b2ec30e2e3a0 by Nate Graham, on behalf of Marcin Gurtowski.
Committed on 02/08/2021 at 16:54.
Pushed by ngraham into branch 'master'.

Fix creating thumbnails for items under desktop:/

By using KFileItem::localPath() which will return url.toLocalFile()
or UDS_LOCAL_PATH, so it works for all URLS.
FIXED-IN: 5.85

M  +1    -1    src/widgets/previewjob.cpp

https://invent.kde.org/frameworks/kio/commit/2c01ea964f53aba93afaf22e3e63b2ec30e2e3a0