[Commits] [SCM] claws branch, master, updated. 3.17.6-3-g4099289a7

paul at claws-mail.org paul at claws-mail.org
Mon Aug 17 11:47:32 CEST 2020


The branch, master has been updated
       via  4099289a72d9007c4b054babd6eabe915add5a31 (commit)
      from  5cc88aae7217d6ea385a580a30dc79ea0c91c27f (commit)

Summary of changes:
 src/gtk/gtkutils.c | 43 +++++++++++++++++--------------------------
 1 file changed, 17 insertions(+), 26 deletions(-)


- Log -----------------------------------------------------------------
commit 4099289a72d9007c4b054babd6eabe915add5a31
Author: Paul <paul at claws-mail.org>
Date:   Mon Aug 17 10:47:25 2020 +0100

    improve image display, particularly for large images, especially if taller than they are wide

diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c
index 4eea7fb31..f09d5a84f 100644
--- a/src/gtk/gtkutils.c
+++ b/src/gtk/gtkutils.c
@@ -1750,32 +1750,6 @@ GdkPixbuf *claws_load_pixbuf_fitting(GdkPixbuf *src_pixbuf, int box_width,
 		}
 	}
 
-	w = gdk_pixbuf_get_width(pixbuf);
-	h = gdk_pixbuf_get_height(pixbuf);
-
-	if (angle == 90 || angle == 270) {
-		avail_height = box_width;
-		avail_width = box_height;
-	} else {
-		avail_width = box_width;
-		avail_height = box_height;
-	}
-
-	/* Scale first */
-	if (box_width != -1 && box_height != -1 && avail_width - 100 > 0) {
-		if (w > avail_width) {
-			h = (avail_width * h) / w;
-			w = avail_width;
-		}
-		if (h > avail_height) {
-			w = (avail_height * w) / h;
-			h = avail_height;
-		}
-		t_pixbuf = gdk_pixbuf_scale_simple(pixbuf, 
-			w, h, GDK_INTERP_BILINEAR);
-		g_object_unref(pixbuf);
-		pixbuf = t_pixbuf;
-	}
 
 	/* Rotate if needed */
 	if (angle != 0) {
@@ -1798,6 +1772,23 @@ GdkPixbuf *claws_load_pixbuf_fitting(GdkPixbuf *src_pixbuf, int box_width,
 		pixbuf = t_pixbuf;
 	}
 
+	w = gdk_pixbuf_get_width(pixbuf);
+	h = gdk_pixbuf_get_height(pixbuf);
+
+	avail_width = box_width;
+	avail_height = box_height;
+		
+	if (box_width != -1 && box_height != -1 && avail_width - 100 > 0) {
+		if (w > avail_width || h > avail_height) {
+			h = (avail_width * h) / w;
+			w = avail_width;
+		}
+		t_pixbuf = gdk_pixbuf_scale_simple(pixbuf, 
+			w, h, GDK_INTERP_BILINEAR);
+		g_object_unref(pixbuf);
+		pixbuf = t_pixbuf;
+	}
+
 	return pixbuf;
 }
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list