GdkPixbuf: ICO files with multiple sizes
- From: <c buhtz posteo jp>
- To: python-hackers-list gnome org
- Subject: GdkPixbuf: ICO files with multiple sizes
- Date: Mon, 10 Jun 2019 14:17:23 +0200
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)
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]