← Back to issue list

appstream/desktop file icon extraction missing

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1814898
Type
issue
State
closed
Author
~apachelogger
Labels
19.04 19.04-blue
Created
Updated
Closed

Current evaluation

Fixed by merged PR snapcore/snapcraft#2512 (commit 9e8601b80), adding desktop-file Icon= fallback and stock-icon lookup through the hicolor theme.

Resolution: closed resolved

Reason: Commit 9e8601b80 implements the proposed fix from PR #2512, including desktop-file fallback and themed icon resolution. PR #2543 subsequently corrected an associated icon unit-test typo.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Currently the icon.{png,svg} is not being properly extracted via appstream/desktop file information. The current code expects the appstream data to contain something like `<icon type="local">assets/icon.png</icon>` which won't actually exist 99% of the time. The icon tags are almost exclusively injected by appstream-generator which is a distro-level tool that assembles "finalized" appstream. Part of this finalization is determining the actual icon files to use. For most applications the icon will be installed into an icon theme so the most suitable resolution is picked up. As such the current icon support is largely useless :| What needs to happen is the following: - existing code to look for icon tag - if no icon tag OR icon is not an absolute path OR absolute path doesn't exist in tree: - find desktop file (this may be set via <launchable> or inferred from <id> as is already the case in appstream.py) - get icon from desktop file - if icon is absolute path - use that - else - do an icon lookup [1] against the hicolor theme - (ideally one would actually be able to specify an additional "master" theme which is checked before hicolor; hicolor is the generic fallback but not necessarily the ideal visuals to use from a branding POV) NB: beware that theme icons may be png, xpm, svg, or svgz. Raising an error when an unsupported format is found is likely required (also unzipping svgz may be handy). Implementing this would also allow extending the current support so it not only supports `<icon type="local">` but also `<icon type="stock">` which is depending on the icon lookup. [1] https://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by merged PR snapcore/snapcraft#2512 (commit 9e8601b80), adding desktop-file Icon= fallback and stock-icon lookup through the hicolor theme.
stealth/space-bunny-alpha — closed resolved Fixed in merged PR snapcore/snapcraft#2512 (commit 9e8601b80), adding desktop-file icon fallback and hicolor-theme lookup for AppStream metadata.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR snapcore/snapcraft#2512 (9e8601b80), adding stock-icon lookup and desktop-file Icon= fallback; initial icon/desktop extraction landed in #1853.
stealth/space-bunny-alpha — closed resolved AppStream icon handling was completed in PR #1853 (ce3209468) and improved by PR #2512 (9e8601b80) to resolve stock icons with desktop-file fallbacks.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The requested desktop file and theme icon extraction fallback was never implemented. Likely abandoned due to inactivity.
qwen/qwen3.6-35b-a3b — — Closed without implementation. Proposed enhancing icon extraction by falling back to desktop file metadata and implementing hicolor theme lookup for multiple formats and stock icons. The feature request was abandoned.

Update history

Date Change
created

Related work

  • Likely Fixed By: snapcore/snapcraft#2512 (confidence 100%)

    Merged commit 9e8601b80 implements improved AppStream icon handling.

  • Related To: snapcore/snapcraft#2543 (confidence 99%)

    Follow-up commit ba7c6e137 fixed a typo in the AppStream icon unit test.

Related issues

Issue Project State Summary Similarity
#1828 Support desktop and icon in appstream handler snapcraft closed AppStream metadata gained icon and desktop support in merged PR canonical/snapcraft#1853 (commit ce3209468), closing the feature request.
75%
#1805431 adopt-info not finding desktop files snapcraft (launchpad) closed AppStream desktop-file lookup was fixed by merged PR snapcraft#2435 (commit 63a365159), correcting relative path resolution during extraction and metadata adoption.
72%
#2435 Appstream desktop snapcraft merged Merged PR #2435 added AppStream-derived desktop-file support to Snapcraft, updating 10 files with 95.91% diff coverage.
71%