changeset 28242:f200f7628962

merge of '37aa00d044431100d37466517568640cb082680c' and '7fb07587f5c87cbf108267d40521da8e2ec4d6fd'
author Marcus Lundblad <ml@update.uu.se>
date Mon, 07 Sep 2009 19:33:37 +0000
parents c51f00627af4 (current diff) a6cfb7bf8c88 (diff)
children b6cc239e2564
files
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtksmiley.c	Mon Sep 07 18:28:28 2009 +0000
+++ b/pidgin/gtksmiley.c	Mon Sep 07 19:33:37 2009 +0000
@@ -601,10 +601,17 @@
 		GdkPixbuf *smiley_image = pidgin_pixbuf_from_imgstore(img);
 		purple_imgstore_unref(img);
 
-		if (smiley_image != NULL)
-			sized_smiley = gdk_pixbuf_scale_simple(smiley_image,
+		if (smiley_image != NULL) {
+			if (gdk_pixbuf_get_width(smiley_image) > 22 ||
+				gdk_pixbuf_get_height(smiley_image) > 22) {
+				sized_smiley = gdk_pixbuf_scale_simple(smiley_image,
 					22, 22, GDK_INTERP_HYPER);
-		g_object_unref(G_OBJECT(smiley_image));
+				g_object_unref(G_OBJECT(smiley_image));
+			} else {
+				/* don't scale up smaller smileys, avoid blurryness */
+				sized_smiley = smiley_image;
+			}
+		}
 	}