summaryrefslogtreecommitdiff
path: root/src/file-manager
diff options
context:
space:
mode:
authorrbuj <[email protected]>2022-02-09 12:26:35 +0100
committermbkma <[email protected]>2022-07-22 08:48:41 +0200
commit160d754f2228e74daea5735c9fb6655e082de906 (patch)
treea91ae7eb2fd831f4f87c36b9bf021a5df1be7848 /src/file-manager
parentb90c1c21ded05281f5ed9dfbbaac764f918300f8 (diff)
downloadcaja-160d754f2228e74daea5735c9fb6655e082de906.tar.bz2
caja-160d754f2228e74daea5735c9fb6655e082de906.tar.xz
Fix build warning -Wbad-function-cast
Diffstat (limited to 'src/file-manager')
-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;