changeset 10406:8ee13eecfee0

[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>
author Mark Doliner <mark@kingant.net>
date Fri, 24 Dec 2004 01:32:12 +0000
parents 046be0a754b6
children 3fcfab5f0cc6
files src/gtkaccount.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);