From 160d754f2228e74daea5735c9fb6655e082de906 Mon Sep 17 00:00:00 2001 From: rbuj Date: Wed, 9 Feb 2022 12:26:35 +0100 Subject: Fix build warning -Wbad-function-cast --- src/file-manager/fm-properties-window.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/file-manager') 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; -- cgit v1.2.1