Re: GdkPixbuf: ICO files with multiple sizes



Hi,

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.

Benjamin

On Sun, 2019-06-16 at 22:05 +0200, c.buhtz--- via python-hackers-list
wrote:
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
is
me or the ico file itself is not valid.

https://www.jabref.org/favicon.ico

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
can
see the icon in multiple sizes (each in one GIMP layer).

Fine.

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
Gtk.TreeView
and I want to store it back into an ico file.

This doesn't work because the scaled result looks like picture
noise
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', '', '')

and

org = GdkPixbuf.Pixbuf.new_from_file_at_size('_favicon.ico', 16,
16)
_______________________________________________
python-hackers-list mailing list
python-hackers-list gnome org
https://mail.gnome.org/mailman/listinfo/python-hackers-list

_______________________________________________
python-hackers-list mailing list
python-hackers-list gnome org
https://mail.gnome.org/mailman/listinfo/python-hackers-list

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]