summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Doliner <markdoliner@pidgin.im>2010-04-21 04:42:32 +0000
committerMark Doliner <markdoliner@pidgin.im>2010-04-21 04:42:32 +0000
commit401c01107ea0c97543361433a50d600164e780dc (patch)
tree4f69fdad1e8fc7b92290eab30f3e00fa1fc43d00
parenta42ee8ae9a5acc68d7db220d47ac93d6ef68983a (diff)
downloadpidgin-401c01107ea0c97543361433a50d600164e780dc.tar.gz
Oh! When setting a buddy icon, when we reduce the dimension in order to
make the icon smaller than the max file size, make sure we respect the minimum dimensions specified by the prpl. I guess I removed this when I made this code awesome. Probably not a huge problem, though--it's the difference between trying to set an icon that is "too small" or just bailing out immediately and telling the user to pick a different image.
-rw-r--r--pidgin/gtkutils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c
index 827e27efd4..93f5e86b6f 100644
--- a/pidgin/gtkutils.c
+++ b/pidgin/gtkutils.c
@@ -2507,7 +2507,7 @@ pidgin_convert_buddy_icon(PurplePlugin *plugin, const char *path, size_t *len)
new_height = orig_height * scale_factor;
g_object_unref(G_OBJECT(pixbuf));
pixbuf = gdk_pixbuf_scale_simple(original, new_width, new_height, GDK_INTERP_HYPER);
- } while (new_width > 10 || new_height > 10);
+ } while ((new_width > 10 || new_height > 10) && new_width > spec->min_width && new_height > spec->min_height);
g_strfreev(prpl_formats);
g_object_unref(G_OBJECT(pixbuf));
g_object_unref(G_OBJECT(original));