diff options
author | rbuj <[email protected]> | 2022-07-27 10:54:35 +0200 |
---|---|---|
committer | Luke from DC <[email protected]> | 2022-09-11 17:27:42 +0000 |
commit | 2b1f1acf3ba1d2d1075919f0eabc83f7d208cb8c (patch) | |
tree | 4c80b31a0872d1c4ab0081ed7d4828f6b3c1b3b9 | |
parent | 2e5d87ab81962f2e34f9106eadde6474b5826ff1 (diff) | |
download | eom-2b1f1acf3ba1d2d1075919f0eabc83f7d208cb8c.tar.bz2 eom-2b1f1acf3ba1d2d1075919f0eabc83f7d208cb8c.tar.xz |
eom-close-confirmation-dialog: fix -Wbad-function-cast warning
-rw-r--r-- | src/eom-close-confirmation-dialog.c | 16 |
1 files 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 (); |