diff src/thumb.c @ 14:25335c62cd9b

##### Note: GQview CVS on sourceforge is not always up to date, please use ##### ##### an offical release when making enhancements and translation updates. ##### Thu Mar 3 01:16:23 2005 John Ellis <johne@verizon.net> * pan-view.c: Add 'dots' image size option, fix up border size at edge of grid, and make drag and drop work to/from the window. Wed Mar 2 23:34:30 2005 John Ellis <johne@verizon.net> * globals.c, gqview.h, rcfile.c: Add thumbnail_fast option variable. * image-load.c, typedefs.h: Add shrunk flag to determine if an image was scaled down using image_loader_set_requested_size. * image.c: Make panning with mouse scroll more when holding shift key. * preferences.c: Add option for 'Fast jpeg thumbnailing' and disabled xvpics option in the gui - now a hidden option. * thumb.c, thumb_standard.c: Add support for thumbnail_fast option..
author gqview
date Thu, 03 Mar 2005 06:32:53 +0000
parents d907d608745f
children 71e1ebee420e
line wrap: on
line diff
--- a/src/thumb.c	Wed Mar 02 02:47:53 2005 +0000
+++ b/src/thumb.c	Thu Mar 03 06:32:53 2005 +0000
@@ -182,16 +182,16 @@
 		{
 		gint w, h;
 
-		if (((float)tl->max_w / pw) < ((float)tl->max_h / ph))
+		if (((double)tl->max_w / pw) < ((double)tl->max_h / ph))
 			{
 			w = tl->max_w;
-			h = (float)w / pw * ph;
+			h = (double)w / pw * ph;
 			if (h < 1) h = 1;
 			}
 		else
 			{
 			h = tl->max_h;
-			w = (float)h / ph * pw;
+			w = (double)h / ph * pw;
 			if (w < 1) w = 1;
 			}
 
@@ -202,7 +202,7 @@
 		{
 		tl->pixbuf = pixbuf;
 		gdk_pixbuf_ref(tl->pixbuf);
-		save = FALSE;
+		save = il->shrunk;
 		}
 
 	/* save it ? */
@@ -254,10 +254,11 @@
 	image_loader_free(tl->il);
 	tl->il = image_loader_new(path);
 
-#if 0
-	/* this will speed up jpegs by up to 3x in some cases */
-	image_loader_set_requested_size(tl->max_w, tl->max_h);
-#endif
+	if (thumbnail_fast)
+		{
+		/* this will speed up jpegs by up to 3x in some cases */
+		image_loader_set_requested_size(tl->il, tl->max_w, tl->max_h);
+		}
 
 	image_loader_set_error_func(tl->il, thumb_loader_error_cb, tl);
 	if (tl->func_progress) image_loader_set_percent_func(tl->il, thumb_loader_percent_cb, tl);