I have a problem loading PNG images in Gtk3. I have broken image symbols in my ToolButtons and after some investigation it appears that it comes from GdkPixbuf not being able to read the PNG files.
I have reproduced the problem with the python console
>>> from gi.repository import GdkPixbuf
>>> print(GdkPixbuf)
<gi.module.DynamicModule 'GdkPixbuf' from '/home/user1/ctcils/dusserm/applications/gobject-introspection/1.40.0/lib/girepository-1.0/GdkPixbuf-2.0.typelib'>
>>> GdkPixbuf.Pixbuf.new_from_file("/home/user1/ctcils/dusserm/applications/pycharm-community-3.4.1/bin/pycharm.png")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
gi._glib.GError: Couldn't recognize the image file format for file '/home/user1/ctcils/dusserm/applications/pycharm-community-3.4.1/bin/pycharm.png'
Many of the problems I faced in the last days were due to the fact we had to compile Gtk3, pygobject and all their dependencies and to install them in non-standard directories. I suspect a problem with the gobject introspection (the last from a long list).
I got a similar error with unusual prefix, and solved it by setting
XDG_DATA_DIRS
, which I didn't have set.Source: https://bugs.gentoo.org/644136