Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gtk gtk
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,468
    • Issues 1,468
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 247
    • Merge requests 247
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • gtkgtk
  • Issues
  • #1955

Closed
Open
Created Jun 17, 2019 by buhtz@buhtz

GdkPixbuf: ICO files with multiple sizes

This issues is related to this mailinglist posting https://mail.gnome.org/archives/python-hackers-list/2019-June/msg00000.html where I was recommanded to open a bug report for it.

Short: Loading a ico-file containing different resolutions as a GdkPixbuf.Pixbuf causing picutre noise like on an old TV.

This is about PyGobject with Python 3.

Please see this example ico file. I am not sure if the problem is 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 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). I want to use this Pixbuf 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)

Assignee
Assign to
Time tracking