# HG changeset patch # User Olaf Wintermann # Date 1731531770 -3600 # Node ID b47bda6666ce2574375a984e658a6eb85f514e69 # Parent aad99285865c867ea72050cb8c4574927f2054aa fix gtk3 image loading diff -r aad99285865c -r b47bda6666ce ui/gtk/image.c --- a/ui/gtk/image.c Wed Nov 13 21:30:18 2024 +0100 +++ b/ui/gtk/image.c Wed Nov 13 22:02:50 2024 +0100 @@ -93,12 +93,12 @@ GdkPixbuf *pixbuf = value; if(pixbuf) { - int width, height; -#if GTK_CHECK_VERSION(4, 12, 0) + int width = gdk_pixbuf_get_width(pixbuf); + int height = gdk_pixbuf_get_height(pixbuf); + +#if GTK_CHECK_VERSION(4, 0, 0) GdkTexture *texture = gdk_texture_new_for_pixbuf(pixbuf); gtk_picture_set_paintable(GTK_PICTURE(g->obj), GDK_PAINTABLE(texture)); - width = gdk_texture_get_width(texture); - height = gdk_texture_get_height(texture); #else gtk_image_set_from_pixbuf(GTK_IMAGE(g->obj), pixbuf); #endif