Windows GTK3 Image Error

Hey there,

I’m trying to create a hello world like app on win10 with Glade 3.38.2 but with a Gtk::Image

Since then I’m experiencing crashs or errors:

Gtk-WARNING **: 21:40:26.702: Could not load a pixbuf from /org/gtk/libgtk/icons/16x16/status/image-missing.png.This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:…/gtk±3.24.25/gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3) Bail out! Gtk:ERROR:…/gtk±3.24.25/gtk/gtkiconhelper.c:494:ensure_surface_for_g
icon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)

I’m using C++ and the gtkmm bindings and for compilation mingw64 with:
g++ pkg-config --cflags gtkmm-3.0 -o s s.cpp pkg-config --libs gtkmm-3.0

But when executing the app I’m using the normal cmd from the executing directory, which worked if catched or without image fine. The idea is to compile to an exe which can run as standalone therefore all linked dll (ldd s.exe) from mingw were copied into the executing directory

tried:

  • After the first few crashs I tried to add gdk-pixbuf-2.0 to the lib and includes but without result.
  • Also I specified the Image in the beginning in Glade but changed to load via
    auto image = Gdk::Pixbuf::create_from_file(“z.jpg”);
    Glib::RefPtrGtk::Image::cast_dynamic(b->get_object(“image”))->set(image);
    but also unsuccessful
  • I hoped to get more infos when catching the error and printing with what() but just prints
    PixbufError: Couldn
  • I tried out of curiosity what happens if I select a Stock Image see Error below

Error with Stock Img

(s.exe:36060): Gtk-WARNING **: 23:20:07.734: Could not load a pixbuf from /org/g
tk/libgtk/icons/22x22/actions/gtk-cancel.png.
This may indicate that pixbuf loaders or the mime database could not be found.

(s.exe:36060): Gtk-WARNING **: 23:20:07.750: Error loading theme icon ‘gtk-cance
l’ for stock: Failed to load /org/gtk/libgtk/icons/22x22/actions/gtk-cancel.png:
Unrecognized image file format

(s.exe:36060): Gtk-WARNING **: 23:20:07.766: Error loading theme icon ‘image-mis
sing’ for stock: Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing
.png: Unrecognized image file format

(s.exe:36060): Gdk-CRITICAL **: 23:20:07.797: gdk_cairo_surface_create_from_pixb
uf: assertion ‘GDK_IS_PIXBUF (pixbuf)’ failed

(s.exe:36060): GLib-GObject-CRITICAL **: 23:20:07.812: g_object_unref: assertion
‘G_IS_OBJECT (object)’ failed

Qs

  • I have read that it could depend on the mime cache or sth like that and tried
    $ update-mime-database /usr/share

Failed to rename B:/msys64/usr/share/icons.new as B:/msys64/usr/share/icons: File exists
But I’m not sure that this is the cause, and would it be possible to write a custom path so that it could be loaded out of the project/executing directory ?

  • In Glade in the Preview the Image is drawn fine, so i don’t think the mime cache or pixbuf general should be the problem (hypothetically )
  • general ideas or solutions

V

  • Win 10
  • Mingw64
  • Glade 3 38.2
  • GTK3 with gtkmm

Thank you
Best Regards Javes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.