summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/file-manager/fm-properties-window.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c
index 2b38788d..ad355570 100644
--- a/src/file-manager/fm-properties-window.c
+++ b/src/file-manager/fm-properties-window.c
@@ -5675,14 +5675,17 @@ update_preview_callback (GtkFileChooser *icon_chooser,
if (gdk_pixbuf_get_width (pixbuf) > PREVIEW_IMAGE_WIDTH) {
double scale;
+ gint height;
+ gint width;
- scale = (double)gdk_pixbuf_get_height (pixbuf) /
- gdk_pixbuf_get_width (pixbuf);
+ height = gdk_pixbuf_get_height (pixbuf);
+ width = gdk_pixbuf_get_width (pixbuf);
+ scale = ((double) height) / ((double) width);
scaled_pixbuf = gdk_pixbuf_scale_simple
(pixbuf,
PREVIEW_IMAGE_WIDTH,
- scale * PREVIEW_IMAGE_WIDTH,
+ (int) (scale * (double) PREVIEW_IMAGE_WIDTH),
GDK_INTERP_HYPER);
g_object_unref (pixbuf);
pixbuf = scaled_pixbuf;