Submitted By: Guy Dalziel <gdalziel at linuxfromscratch dot org> 
Date: 2009-10-21
Initial Package Version: 2.18.3 
Origin: Romain Perier <mrpouet at gentoo dot org>.
Description: Fixes compatibility with libjpeg 7 which has changed the range of allowable
             scaling factors. The fix is designed to be backwards-compatible with libjpeg
             6.

diff -Naur gtk+-2.18.3.orig/gdk-pixbuf/io-jpeg.c gtk+-2.18.3/gdk-pixbuf/io-jpeg.c
--- gtk+-2.18.3.orig/gdk-pixbuf/io-jpeg.c	2009-10-09 06:00:43.000000000 +0100
+++ gtk+-2.18.3/gdk-pixbuf/io-jpeg.c	2009-10-21 17:42:01.772276783 +0100
@@ -922,7 +922,11 @@
 			}
 			
 			cinfo->scale_num = 1;
+#if JPEG_LIB_VERSION >= 70
+			for (cinfo->scale_denom = 2; cinfo->scale_denom <= 16; cinfo->scale_denom *= 2) {
+#else
 			for (cinfo->scale_denom = 2; cinfo->scale_denom <= 8; cinfo->scale_denom *= 2) {
+#endif
 				jpeg_calc_output_dimensions (cinfo);
 				if (cinfo->output_width < width || cinfo->output_height < height) {
 					cinfo->scale_denom /= 2;
