From 2b1f1acf3ba1d2d1075919f0eabc83f7d208cb8c Mon Sep 17 00:00:00 2001 From: rbuj Date: Wed, 27 Jul 2022 10:54:35 +0200 Subject: eom-close-confirmation-dialog: fix -Wbad-function-cast warning --- src/eom-close-confirmation-dialog.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/eom-close-confirmation-dialog.c b/src/eom-close-confirmation-dialog.c index ad8dc63..b862ba0 100644 --- a/src/eom-close-confirmation-dialog.c +++ b/src/eom-close-confirmation-dialog.c @@ -451,8 +451,6 @@ populate_model (GtkTreeModel *store, GList *imgs) const gchar *name; GdkPixbuf *buf = NULL; GdkPixbuf *buf_scaled = NULL; - int width; - double ratio; img = EOM_IMAGE (imgs->data); @@ -460,9 +458,17 @@ populate_model (GtkTreeModel *store, GList *imgs) buf = eom_image_get_thumbnail (img); if (buf) { - ratio = IMAGE_COLUMN_HEIGHT / (double) gdk_pixbuf_get_height (buf); - width = (int) (gdk_pixbuf_get_width (buf) * ratio); - buf_scaled = gdk_pixbuf_scale_simple (buf, width, IMAGE_COLUMN_HEIGHT, GDK_INTERP_BILINEAR); + int height; + int width; + double ratio; + + height = gdk_pixbuf_get_height (buf); + ratio = IMAGE_COLUMN_HEIGHT / (double) height; + width = gdk_pixbuf_get_width (buf); + buf_scaled = gdk_pixbuf_scale_simple (buf, + (int) (ratio * (double) width), + IMAGE_COLUMN_HEIGHT, + GDK_INTERP_BILINEAR); } else buf_scaled = get_nothumb_pixbuf (); -- cgit v1.2.1