Error loading png with gtk_image_set_from_file or gdk_pixbuf_new_from_file
I use Debian (11.1), installed : Xfce (4.16), libgtk-3-dev (3.24) build-essential (10.2.1-6)
If i call :
Image_AchtungGefahrLinks = gtk_image_new (); gtk_image_set_from_file (GTK_IMAGE (Image_AchtungGefahrLinks), "./__png's/achtunggefahrleer.png"); gtk_fixed_put (GTK_FIXED(AlteVersionWindowFixedLayout), Image_AchtungGefahrLinks, 15, 530-7+25);
I receive :
Gtk-WARNING **: 14:21:42.596: 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/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Format der Bilddatei unbekannt (gdk-pixbuf-error-quark, 3) Bail out! Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Format der Bilddatei unbekannt (gdk-pixbuf-error-quark, 3) Aborted
if i call :
GError *error = NULL; GdkPixbuf *pix = gdk_pixbuf_new_from_file ("./__png's/achtunggefahrleer.png", &error); if (pix == NULL) { g_printerr ("Error loading file: #%d %s\n", error->code, error->message); g_error_free (error); exit (1); } GtkWidget *widget = gtk_image_new_from_pixbuf (pix);
I receive :
Error loading file: gtkmm#3 (closed) Das Format der Bilddatei »./__png's/achtunggefahrleer.png« konnte nicht erkannt werden
the loaders are in /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders
the loaders.cache is in /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/
the png info in loaders.cache is "/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so" "png" 5 "gdk-pixbuf" "PNG" "LGPL" "image/png" "" "png" "" "\211PNG\r\n\032\n" "" 100
it seems that the pixbuf loaders can not be found
the image-missing.png is in
/usr/share/icons/Adwaita/16x16/status/ or /usr/share/icons/Tango/16x16/status/ or /usr/share/icons/gnome/16x16/status/ or /usr/share/man/man1/gtk+3.0-3.24.24/gtk/icons/16x16/status
but it searchs it in /org/gtk/libgtk/icons/16x16/status