Bug 413812 - Discover displays empty area for screenshots that are invalid
Summary: Discover displays empty area for screenshots that are invalid
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: discover (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dan Leinir Turthra Jensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-04 17:27 UTC by Nate Graham
Modified: 2019-11-06 15:28 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

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