commit eab0ddd5f10c2a5a9ee487015d8922c5404c7227
parent 9fb890dee9461adf155c1048afe73501c527796f
Author: Andrej Kacian <ticho@claws-mail.org>
Date: Wed, 6 Mar 2019 18:11:03 +0100
Restore compatibility with gdk-pixbuf version 2.26
Diffstat:
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
@@ -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"
diff --git a/src/image_viewer.c b/src/image_viewer.c
@@ -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(