TheAssassin/appimagelint

Does not handle svgz properly

Closed this issue · 7 comments

As per the xdg icon spec, svgz is an allowed format.

me@host:~$ /isodevice/Applications/kdenlive-19.04.2d-x86_64.appimage'
(...)
appimagelint.icon_check[4820] [WARNING] Icon has invalid extension: .svgz
appimagelint.icon_check[4820] [INFO] Checking resolution of icon: /tmp/.mount_kdenliKrW8nP/usr/share/icons/hicolor/scalable/apps/kdenlive.svgz
appimagelint.icon_check[4820] [ERROR] Failed to identify icon /tmp/.mount_kdenliKrW8nP/usr/share/icons/hicolor/scalable/apps/kdenlive.svgz
Traceback (most recent call last):
  File "/tmp/.mount_appimakQLSlC/usr/conda/lib/python3.7/site-packages/appimagelint/checks/icons.py", line 266, in _get_icon_res
    im = Image.open(icon_path)
  File "/tmp/.mount_appimakQLSlC/usr/conda/lib/python3.7/site-packages/PIL/Image.py", line 2705, in open
    % (filename if filename else fp))
OSError: cannot identify image file '/tmp/.mount_kdenliKrW8nP/usr/share/icons/hicolor/scalable/apps/kdenlive.svgz'
appimagelint.icon_check[4820] [ERROR] could not detect resolution in icon file /tmp/.mount_kdenliKrW8nP/usr/share/icons/hicolor/scalable/apps/kdenlive.svgz
appimagelint.icon_check[4820] [WARNING] icon /tmp/.mount_kdenliKrW8nP/usr/share/icons/hicolor/scalable/apps/kdenlive.svgz has invalid resolution
appimagelint.icon_check[4820] [ERROR] Failed to identify icon /tmp/.mount_kdenliKrW8nP/usr/share/icons/hicolor/scalable/apps/kdenlive.svgz
Traceback (most recent call last):
  File "/tmp/.mount_appimakQLSlC/usr/conda/lib/python3.7/site-packages/appimagelint/checks/icons.py", line 266, in _get_icon_res
    im = Image.open(icon_path)
  File "/tmp/.mount_svgzappimakQLSlC/usr/conda/lib/python3.7/site-packages/PIL/Image.py", line 2705, in open
    % (filename if filename else fp))
OSError: cannot identify image file '/tmp/.mount_kdenliKrW8nP/usr/share/icons/hicolor/scalable/apps/kdenlive.svgz'
appimagelint.icon_check[4820] [ERROR] Icon resolution doesn't match resolution in path: scalable (file resolution is None)
appimagelint.icon_check[4820] [WARNING] Icon found whose file name doesn't match the Icon= entry in desktop file: hicolor/scalable/mimetypes/application-x-kdenlive.svgz
appimagelint.icon_check[4820] [WARNING] Icon found whose file name doesn't match the Icon= entry in desktop file: hicolor/scalable/mimetypes/application-x-kdenlivetitle.svgz
appimagelint.icon_check[4820] [WARNING] Icon found whose file name doesn't match the Icon= entry in desktop file: hicolor/scalable/mimetypes/video-mlt-playlist.svgz
appimagelint.icon_check[4820] [WARNING] no other icons found
appimagelint.icon_check[4820] [INFO] [✖] Other integration icons valid

Got a link to that section in the spec?

Interesting, https://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html doesn't mention .svgz indeed. I wonder where I had seen it. (I have not made it up.)

Sure, I was just wondering whether there's more documents about it. I couldn't recall that either. Probably one of the many extensions to the XDG icon standard DEs have implemented.

Maybe @ximion knows?

No, svgz is definitely not permitted as per the XDG Icon Theme specification. The KDE Plasma desktop has it extended to support that icon format (and I think that's the only place where it is formally supported), and I kind of support this as well in appstream-generator. I also was absolutely sure that I submitted a patch to include svgz in the spec, but it looks like I didn't.
Maybe it's time for that now.

So, that means for now this appimagelint behaves correctly, the issue can be closed, and shall be reopened when the spec changes.

@ximion if you remember at that point, please notify us then, thanks.

No, svgz is definitely not permitted as per the XDG Icon Theme specification.

Thanks @ximion for the clarification.

That means we should remove svgz support from all AppImage tools and throw an error if we encounter one.

The KDE Plasma desktop has it extended to support that icon forma

That's the kind of stuff that leads to the impression that stuff is always half-working on "Linux" - here the icon shows, there it doesn't,... you never can trust that if it works on your machine it will work everywhere.