[nautilus] file: make sure not to use a 0 width/height when scaling the image



commit b3da52fefdbf5dc6f8f95fe381181dc47e54d5c3
Author: Stefano Teso <stefano teso gmail com>
Date:   Wed Sep 7 17:58:58 2011 -0400

    file: make sure not to use a 0 width/height when scaling the image
    
    The problem is that for extreme height-to-width ratio images,
    gdk_pixbuf_scale_simple () is called with either width or height = 0
    (printing a critical warning to the terminal).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=329010

 libnautilus-private/nautilus-file.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index dc43614..7c97fda 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -4225,7 +4225,8 @@ nautilus_file_get_icon (NautilusFile *file,
 			}
 
 			scaled_pixbuf = gdk_pixbuf_scale_simple (raw_pixbuf,
-								 w * scale, h * scale,
+								 MAX (w * scale, 1),
+								 MAX (h * scale, 1),
 								 GDK_INTERP_BILINEAR);
 
 			/* We don't want frames around small icons */



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