Restore compatibility with gdk-pixbuf version 2.26
authorAndrej Kacian <ticho@claws-mail.org>
Wed, 6 Mar 2019 17:11:03 +0000 (18:11 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Wed, 6 Mar 2019 17:11:03 +0000 (18:11 +0100)
configure.ac
src/image_viewer.c

index 6ae4c10..412a3f0 100644 (file)
@@ -440,7 +440,7 @@ dnl ** common code **
 dnl *****************
 
 dnl check for glib
-PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28 gmodule-2.0 >= 2.28 gobject-2.0 >= 2.28 gthread-2.0 >= 2.28)
+PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.28 gmodule-2.0 >= 2.28 gobject-2.0 >= 2.28 gthread-2.0 >= 2.28])
 
 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
 AC_SUBST(GLIB_GENMARSHAL)
@@ -448,6 +448,8 @@ AC_SUBST(GLIB_GENMARSHAL)
 AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
 
+PKG_CHECK_MODULES(GDK_PIXBUF, [gdk-pixbuf-2.0 >= 2.26])
+
 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
 syl_save_LIBS=$LIBS
 LIBS="$LIBS $GTK_LIBS"
index bd33c94..f3f732c 100644 (file)
@@ -89,7 +89,11 @@ static void image_viewer_load_image(ImageViewer *imageviewer)
                return;
        }
 
+#if GDK_PIXBUF_CHECK_VERSION(2, 28, 0)
        animation = gdk_pixbuf_animation_new_from_stream(stream, NULL, &error);
+#else
+       pixbuf = gdk_pixbuf_new_from_stream(stream, NULL, &error);
+#endif
        g_object_unref(stream);
 
        if (error != NULL) {
@@ -98,12 +102,16 @@ static void image_viewer_load_image(ImageViewer *imageviewer)
                return;
        }
 
+#if GDK_PIXBUF_CHECK_VERSION(2, 28, 0)
        if (gdk_pixbuf_animation_is_static_image(animation)
            || imageviewer->resize_img) {
                pixbuf = gdk_pixbuf_animation_get_static_image(animation);
                g_object_ref(pixbuf);
                g_object_unref(animation);
                animation = NULL;
+#else
+       if (imageviewer->resize_img) {
+#endif
 
                if (imageviewer->resize_img) {
                        gtk_widget_get_allocation(