commit 08697167f45960f875d22f82e77bd5b633b8e5a0
parent 1ce55620fdfa1b9d5b9e92e9a7a0d8f87ecc5fa3
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
@@ -430,7 +430,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)
@@ -438,6 +438,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
@@ -88,7 +88,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) {
@@ -97,12 +101,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(imageviewer->scrolledwin, &allocation);