Several bug reports about ICO files with multiple sizes

My question is to the core dev’s here.
There are several bugs reports arround related to problems loading and scaling ICO files with multiple sizes.

Myself I touched that problem while trying to load such a file with PyGObject (Debian stable). Details and an mwe can be found here: https://mail.gnome.org/archives/python-hackers-list/2019-June/msg00000.html

The list of bug reportes I found myself is documented here: https://mail.gnome.org/archives/python-hackers-list/2019-June/msg00003.html

Does all this reports rooting to the same problem?

The bug reports are quite old and it is unclear for me if the problems are still fixed in the dev/upstream version of Gtk/PyGObject. I have currently no idea how to install a upstream version of PyGObject to test arround if my problem can be reproduced their, too. It would be great if some of you could try out my mwe code (see first link).

The other question is how can I go on? I think it do not help if I also open a BugReport for PyGObject. What would you (as core devs) recommand?

Thanks for reporting issues. The ICO loader hasn’t been touched in a while, and mostly to fix security issues. ICO files are not really common on Linux; GdkPixbuf is typically used to load PNG and JPEG assets, and icons are either PNG or SVG files in the icon theme.

If a bug report hasn’t been updated, then it’s likely not fixed.

You can try cloning the project, adding the assets to the test suite, and then running it; the README file has instructions on how to do that. You can also use jhbuild to set up a development environment that won’t interfere with your installed OS.

I honestly don’t have any experience with the ICO format, so I can’t really help in fixing the issues; but I can review patches.

You wrote “ICO files are not really common on Linux”.

But they are common on websites. I load favicons from websites to use them in my Feedreader. Most of the websites using ICO as default format.

If there is a bug no one can fix than the feature (loading ico files) should be removed. Buggy code shouldn’t be left in the project.

Even Gnome itself is using Favicons
https://www.gnome.org/favicon.ico
But this ICO file is corrupt.

Favicons are common on the web, and web browsers have their own image loaders that are, by and large, more featureful than gdkpixbuf.

The ICO loader in GdkPixbuf is roughly stuck to loading the old, 16x16 favicon icons; it hasn’t been updated to load the new style icons that take into account hidpi and multiple form factors because there’s never been the need for that.

I’m not saying that GdkPixbuf can’t be fixed, of course; but nobody is working on that, so somebody who cares about loading web icons will need to submit a merge request.

But then should the GdkPixbuf fixed in that way that it raise an Error if such a “new ico” file is loaded with it. This would prevent confusion and multiple bug reports for the same thing.

Fix it myself is far out of my expertise.

So how could I handle it? Any recommandations about a alternative Python package loading ico files?

Sure; I’d happily review a merge request to that effect.

I’m not really familiar with the Python ecosystem, or the ICO format to give you a sensible answer, I’m sorry.

That explains why I was having trouble dealing with ICO files in Cairo. I did get a bunch of other formats to load and save, though and now that you’ve brought all this to light, I’ll stop worrying about it and stick to PNG for those icon images.

1 Like

I opened a feature request for such an error handling.

Feature Request: raise Exception if “modern” ICO files are loaded

Thanks for opening the issue!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.