Bug 413812

Summary: Discover displays empty area for screenshots that are invalid
Product: [Applications] Discover Reporter: Nate Graham <nate>
Component: discoverAssignee: Dan Leinir Turthra Jensen <leinir>
Status: RESOLVED FIXED    
Severity: normal CC: aleixpol, g-a-d
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=413629
Latest Commit: Version Fixed In:

Description Nate Graham 2019-11-04 17:27:48 UTC
For example, the AppStream info for Virtualbox in Tumbleweed does defines an invalid image URL for its screenshot (https://www.virtualbox.org/attachment/wiki/Screenshots/OpenSuse13.2_on_Windows_7.png). Running discover from the CLI reveals the following error:

qrc:/qml/ApplicationScreenshots.qml:149:17: QML Image: Error decoding: https://www.virtualbox.org/attachment/wiki/Screenshots/OpenSuse13.2_on_Windows_7.png: Unsupported image format

The URL, despite its filename extension, leads to a web page and not to the actual image itself. The actual URL for the image is https://www.virtualbox.org/raw-attachment/wiki/Screenshots/OpenSuse13.2_on_Windows_7.png

In this situation, Discover should not display anything, not even reserving space for the invalid screenshot if it's the only one.
Comment 1 Aleix Pol 2019-11-06 15:28:07 UTC
Git commit d7579e8dedbeca31ef46c7c816ab5dfbc28c1621 by Aleix Pol.
Committed on 06/11/2019 at 15:25.
Pushed by apol into branch 'Plasma/5.17'.

app page: fix display of faulty screenshots

Just remove them from the model when they fail loading

M  +3    -0    discover/qml/ApplicationScreenshots.qml
M  +14   -0    libdiscover/ScreenshotsModel.cpp
M  +2    -0    libdiscover/ScreenshotsModel.h

https://commits.kde.org/discover/d7579e8dedbeca31ef46c7c816ab5dfbc28c1621