# HG changeset patch
# User Mark Doliner <mark@kingant.net>
# Date 1103851932 0
# Node ID 8ee13eecfee0ceaaec1352b3228d3c6ad3817647
# Parent  046be0a754b6b5edb3d33237245b62b55e7dd189
[gaim-migrate @ 11652]
sf patch #1089195, from Graham Cole
Only attempt to scale buddy icons if we actually need to.  This should
avoid some needless blurring of icons that are already the correct size.

committer: Tailor Script <tailor@pidgin.im>

diff -r 046be0a754b6 -r 8ee13eecfee0 src/gtkaccount.c
--- a/src/gtkaccount.c	Fri Dec 24 00:51:06 2004 +0000
+++ b/src/gtkaccount.c	Fri Dec 24 01:32:12 2004 +0000
@@ -546,7 +546,12 @@
 		const char *dirname = gaim_buddy_icons_get_cache_dir();
 		char *filename = g_build_filename(dirname, random, NULL);
 		pixbuf = gdk_pixbuf_new_from_file(path, &error);
-		if (!error && prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_SEND) {
+		if (!error && (prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_SEND) &&
+			(width <= prpl_info->icon_spec.min_width ||
+			 width >= prpl_info->icon_spec.max_width ||
+			 height <= prpl_info->icon_spec.min_height ||
+			 height >= prpl_info->icon_spec.max_height))
+		{
 			int new_width = gdk_pixbuf_get_width(pixbuf);
 			int new_height = gdk_pixbuf_get_height(pixbuf);