[gthumb] re-added check to see if libjpeg support progressive JPEGs



commit 56c1a50514194977949153bf160ba77333e0c450
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Mon Aug 22 14:29:15 2011 +0200

    re-added check to see if libjpeg support progressive JPEGs

 configure.ac                              |    4 ++++
 extensions/pixbuf_savers/gth-jpeg-saver.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 201eb81..c225b6b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -413,6 +413,10 @@ int main(int c, char**v) { return 0; }
 fi
 AM_CONDITIONAL(HAVE_LIBJPEG_80, test "x$have_libjpeg_80" = xyes)
 
+AC_CHECK_LIB(jpeg, jpeg_simple_progression,
+             [AC_DEFINE(HAVE_PROGRESSIVE_JPEG, 1, [Define to 1 if libjpeg supports progressive JPEG.])],
+             [AC_MSG_WARN(JPEG library does not support progressive saving.)])
+
 dnl ===========================================================================
 
 AC_ARG_ENABLE([tiff],
diff --git a/extensions/pixbuf_savers/gth-jpeg-saver.c b/extensions/pixbuf_savers/gth-jpeg-saver.c
index ced0738..03cce0a 100644
--- a/extensions/pixbuf_savers/gth-jpeg-saver.c
+++ b/extensions/pixbuf_savers/gth-jpeg-saver.c
@@ -246,7 +246,9 @@ _gdk_pixbuf_save_as_jpeg (GdkPixbuf   *pixbuf,
 	volatile int       quality = 85; /* default; must be between 0 and 100 */
 	volatile int       smoothing = 0;
 	volatile gboolean  optimize = FALSE;
+#ifdef HAVE_PROGRESSIVE_JPEG
 	volatile gboolean  progressive = FALSE;
+#endif
 	int                i, j;
 	int                w, h = 0;
 	int                rowstride = 0;
@@ -319,6 +321,7 @@ _gdk_pixbuf_save_as_jpeg (GdkPixbuf   *pixbuf,
 					return FALSE;
 				}
 			}
+#ifdef HAVE_PROGRESSIVE_JPEG
 			else if (strcmp (*kiter, "progressive") == 0) {
 				if (strcmp (*viter, "yes") == 0)
 					progressive = TRUE;
@@ -333,6 +336,7 @@ _gdk_pixbuf_save_as_jpeg (GdkPixbuf   *pixbuf,
 					return FALSE;
 				}
 			}
+#endif
 			else {
 				g_warning ("Bad option name '%s' passed to JPEG saver", *kiter);
 				return FALSE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]