Re: GdkPixbuf: ICO files with multiple sizes


seems like a bug in the GdkPixbuf image loader code.

I believe it will always try to load the highest resolution (so you
cannot load the 16x16px version from the icon file). But that doesn't
explain why it isn't decoding the pixel data correctly.


On Sun, 2019-06-16 at 22:05 +0200, c.buhtz--- via python-hackers-list
Does no one has an idea about this?

Did someone test the ico file I linked, too? Can my problem be
reproduced by others?

On 2019-06-10 14:17 "c.buhtz--- via python-hackers-list"
<python-hackers-list gnome org> wrote:
This question is about ico-files which contain more then one icon
usually in multiple sizes.

The current example can be found here. I am not sure if the problem
me or the ico file itself is not valid.

In Firefox the icon looks like expected. When I open the (with
aiohttp) downloaded ico file with IrfanView (via wine on Debian
stable) or with Gimp it looks like expected. Especially in Gimp I
see the icon in multiple sizes (each in one GIMP layer).


I want to open it with GdkPixbuf "scale" it to 16x16 (or select the
correct size). This Pixbuf I want to use as an icon in a
and I want to store it back into an ico file.

This doesn't work because the scaled result looks like picture
on an old TV.

What I tried so far...

org = GdkPixbuf.Pixbuf.new_from_file('_favicon.ico')
small = org.scale_simple(16, 16, 2)
small.savev('small.ico', 'ico', '', '')


org = GdkPixbuf.Pixbuf.new_from_file_at_size('_favicon.ico', 16,
python-hackers-list mailing list
python-hackers-list gnome org

python-hackers-list mailing list
python-hackers-list gnome org

Attachment: signature.asc
Description: This is a digitally signed message part

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]