summaryrefslogtreecommitdiff
path: root/gsearchtool/src/gsearchtool-support.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-04-07 21:23:52 +0200
committerRobert Antoni Buj Gelonch <[email protected]>2020-04-16 14:34:42 +0200
commit2a1375f6937e9edd3b06ffbd5a555ce49a64897a (patch)
treee557cbe60eb7ab087200a5445f316b015d506547 /gsearchtool/src/gsearchtool-support.c
parentb411957943122bb9ba71444eaf9a970c25c63e5b (diff)
downloadmate-utils-2a1375f6937e9edd3b06ffbd5a555ce49a64897a.tar.bz2
mate-utils-2a1375f6937e9edd3b06ffbd5a555ce49a64897a.tar.xz
Remove bad-function-cast warnings
Diffstat (limited to 'gsearchtool/src/gsearchtool-support.c')
-rw-r--r--gsearchtool/src/gsearchtool-support.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gsearchtool/src/gsearchtool-support.c b/gsearchtool/src/gsearchtool-support.c
index 61f456ae..272d089d 100644
--- a/gsearchtool/src/gsearchtool-support.c
+++ b/gsearchtool/src/gsearchtool-support.c
@@ -848,23 +848,27 @@ gsearchtool_get_thumbnail_image (const gchar * thumbnail)
gfloat scale_factor_y = 1.0;
gint scale_x;
gint scale_y;
+ gint width;
+ gint height;
thumbnail_pixbuf = gdk_pixbuf_new_from_file (thumbnail, NULL);
gsearchtool_thumbnail_frame_image (&thumbnail_pixbuf);
- if (gdk_pixbuf_get_width (thumbnail_pixbuf) > ICON_SIZE) {
- scale_factor_x = (gfloat) ICON_SIZE / (gfloat) gdk_pixbuf_get_width (thumbnail_pixbuf);
+ width = gdk_pixbuf_get_width (thumbnail_pixbuf);
+ if (width > ICON_SIZE) {
+ scale_factor_x = (gfloat) ICON_SIZE / (gfloat) width;
}
- if (gdk_pixbuf_get_height (thumbnail_pixbuf) > ICON_SIZE) {
- scale_factor_y = (gfloat) ICON_SIZE / (gfloat) gdk_pixbuf_get_height (thumbnail_pixbuf);
+ height = gdk_pixbuf_get_height (thumbnail_pixbuf);
+ if (height > ICON_SIZE) {
+ scale_factor_y = (gfloat) ICON_SIZE / (gfloat) height;
}
- if (gdk_pixbuf_get_width (thumbnail_pixbuf) > gdk_pixbuf_get_height (thumbnail_pixbuf)) {
+ if (width > height) {
scale_x = ICON_SIZE;
- scale_y = (gint) (gdk_pixbuf_get_height (thumbnail_pixbuf) * scale_factor_x);
+ scale_y = (gint) (height * scale_factor_x);
}
else {
- scale_x = (gint) (gdk_pixbuf_get_width (thumbnail_pixbuf) * scale_factor_y);
+ scale_x = (gint) (width * scale_factor_y);
scale_y = ICON_SIZE;
}