pidgin: 7fb07587: Only scale down larger smileys (more tha...

malu at pidgin.im malu at pidgin.im
Mon Sep 7 15:27:04 EDT 2009


-----------------------------------------------------------------
Revision: 7fb07587f5c87cbf108267d40521da8e2ec4d6fd
Ancestor: d483c0417907450a63d5a5a78cd893109a3bbd48
Author: malu at pidgin.im
Date: 2009-09-07T19:22:32
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/7fb07587f5c87cbf108267d40521da8e2ec4d6fd

Modified files:
        pidgin/gtksmiley.c

ChangeLog: 

Only scale down larger smileys (more than 22 px width or height) in the
smiley manager. This avoids getting smaller smileys being blurry.
Refs #7140

-------------- next part --------------
============================================================
--- pidgin/gtksmiley.c	73151e6c72938612cdc59d472aedb9daf6dcc6a7
+++ pidgin/gtksmiley.c	7fd5127d7500a84f9ea9b5dbe3cf69da3cb61e6c
@@ -601,10 +601,17 @@ static void store_smiley_add(PurpleSmile
 		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;
+			}
+		}
 	}
 
 


More information about the Commits mailing list