diff src/thumb_standard.c @ 40:dcc04a6a58bf

Sat Apr 16 12:29:42 2005 John Ellis <johne@verizon.net> * pan-view.c: Add option to ignore symbolic links to folders when creating file list (no gui control yet), and do not allow listing the root folder as this introduces too many issues (for instance how do we ignore special filesystems such as /proc using only stat attributes?). Add fix to not show empty folders in the flower view. * thumb_standard.c (thumb_loader_std_finish): Fix logic that caused thumbnails to be saved for images with a size between normal and large when using large thumbnails. * ui_fileops.[ch]: Add utilities lstat_utf8 and islink. ##### Note: GQview CVS on sourceforge is not always up to date, please use ##### ##### an offical release when making enhancements and translation updates. #####
author gqview
date Sat, 16 Apr 2005 16:26:49 +0000
parents 25335c62cd9b
children ee03f36e9e4b
line wrap: on
line diff
--- a/src/thumb_standard.c	Thu Apr 14 14:56:17 2005 +0000
+++ b/src/thumb_standard.c	Sat Apr 16 16:26:49 2005 +0000
@@ -451,49 +451,55 @@
 	sw = gdk_pixbuf_get_width(pixbuf);
 	sh = gdk_pixbuf_get_height(pixbuf);
 
-	if (tl->cache_enable && !tl->cache_hit &&
-	    (sw >= THUMB_SIZE_NORMAL || sh >= THUMB_SIZE_NORMAL || shrunk))
+	if (tl->cache_enable)
 		{
-		gint cache_w, cache_h;
-		gint thumb_w, thumb_h;
-
-		if (tl->requested_width > THUMB_SIZE_NORMAL || tl->requested_height > THUMB_SIZE_NORMAL)
+		if (!tl->cache_hit)
 			{
-			cache_w = cache_h = THUMB_SIZE_LARGE;
-			}
-		else
-			{
-			cache_w = cache_h = THUMB_SIZE_NORMAL;
-			}
+			gint cache_w, cache_h;
+
+			if (tl->requested_width > THUMB_SIZE_NORMAL || tl->requested_height > THUMB_SIZE_NORMAL)
+				{
+				cache_w = cache_h = THUMB_SIZE_LARGE;
+				}
+			else
+				{
+				cache_w = cache_h = THUMB_SIZE_NORMAL;
+				}
+
+			if (sw > cache_w || sh > cache_h || shrunk)
+				{
+				gint thumb_w, thumb_h;
 
-		if (thumb_loader_std_scale_aspect(cache_w, cache_h, sw, sh,
-						  &thumb_w, &thumb_h))
-			{
-			pixbuf_thumb = gdk_pixbuf_scale_simple(pixbuf, thumb_w, thumb_h,
-							       (GdkInterpType)thumbnail_quality);
+				if (thumb_loader_std_scale_aspect(cache_w, cache_h, sw, sh,
+								  &thumb_w, &thumb_h))
+					{
+					pixbuf_thumb = gdk_pixbuf_scale_simple(pixbuf, thumb_w, thumb_h,
+									       (GdkInterpType)thumbnail_quality);
+					}
+				else
+					{
+					pixbuf_thumb = pixbuf;
+					g_object_ref(G_OBJECT(pixbuf_thumb));
+					}
+
+				thumb_loader_std_save(tl, pixbuf_thumb);
+				}
 			}
-		else
+		else if (tl->cache_hit &&
+			 tl->cache_local && !tl->thumb_path_local)
 			{
-			pixbuf_thumb = pixbuf;
-			g_object_ref(G_OBJECT(pixbuf_thumb));
+			/* A local cache save was requested, but a valid thumb is in $HOME,
+			 * so specifically save as a local thumbnail.
+			 */
+			g_free(tl->thumb_path);
+			tl->thumb_path = NULL;
+
+			tl->cache_hit = FALSE;
+
+			if (debug) printf("thumb copied: %s\n", tl->source_path);
+
+			thumb_loader_std_save(tl, pixbuf);
 			}
-		
-		thumb_loader_std_save(tl, pixbuf_thumb);
-		}
-	else if (tl->cache_enable && tl->cache_local &&
-		 tl->cache_hit && !tl->thumb_path_local)
-		{
-		/* A local cache save was requested, but a valid thumb is in $HOME,
-		 * so specifically save as a local thumbnail.
-		 */
-		g_free(tl->thumb_path);
-		tl->thumb_path = NULL;
-
-		tl->cache_hit = FALSE;
-
-		if (debug) printf("thumb copied: %s\n", tl->source_path);
-
-		thumb_loader_std_save(tl, pixbuf);
 		}
 
 	if (sw <= tl->requested_width && sh <= tl->requested_height)