[PATCH] Small image icons not rendering in preview in list views



Currently if you have an image that is smaller then the size of the
preview in a list view, you do not get a preview but the ugly "paper"
icon. The attached patch solves that problem. Basically what
happened was that base_size remained 0 when an image was smaller then
the nominal_size. A couple of lines further image was then scaled by
nominal_size / base_size which of course results in an error.

The patch is also in bugzilla http://bugzilla.gnome.org/show_bug.cgi?id=159895

Screenshot before patch
http://bugzilla.gnome.org/attachment.cgi?id=34291&action=view

Screenshot after patch
http://bugzilla.gnome.org/attachment.cgi?id=34293&action=view

Cheers,

Jaap






Index: nautilus-icon-factory.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-factory.c,v
retrieving revision 1.308
diff -u -p -r1.308 nautilus-icon-factory.c
--- nautilus-icon-factory.c	22 Nov 2004 15:24:36 -0000	1.308
+++ nautilus-icon-factory.c	29 Nov 2004 20:03:33 -0000
@@ -1130,11 +1130,7 @@ load_icon_file (const char    *filename,
 		if (force_nominal) {
 			width = gdk_pixbuf_get_width (pixbuf); 
 			height = gdk_pixbuf_get_height (pixbuf);
-			size = MAX (width, height);
-
-			if (size > nominal_size) {
-				base_size = size;
-			}
+			base_size = MAX (width, height);                        
 		} else if (base_size == 0) {
 			if (is_thumbnail) {
 				base_size = 128 * NAUTILUS_ICON_SIZE_STANDARD / NAUTILUS_ICON_SIZE_THUMBNAIL;


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