comparison pidgin/gtkutils.c @ 30181:1a4362fca50e

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.
author Mark Doliner <mark@kingant.net>
date Wed, 21 Apr 2010 04:42:32 +0000
parents 0625cebc84d7
children 9e9c20b705d3
comparison
equal deleted inserted replaced
30180:e68d6c7990c1 30181:1a4362fca50e
2505 scale_factor *= 0.8; 2505 scale_factor *= 0.8;
2506 new_width = orig_width * scale_factor; 2506 new_width = orig_width * scale_factor;
2507 new_height = orig_height * scale_factor; 2507 new_height = orig_height * scale_factor;
2508 g_object_unref(G_OBJECT(pixbuf)); 2508 g_object_unref(G_OBJECT(pixbuf));
2509 pixbuf = gdk_pixbuf_scale_simple(original, new_width, new_height, GDK_INTERP_HYPER); 2509 pixbuf = gdk_pixbuf_scale_simple(original, new_width, new_height, GDK_INTERP_HYPER);
2510 } while (new_width > 10 || new_height > 10); 2510 } while ((new_width > 10 || new_height > 10) && new_width > spec->min_width && new_height > spec->min_height);
2511 g_strfreev(prpl_formats); 2511 g_strfreev(prpl_formats);
2512 g_object_unref(G_OBJECT(pixbuf)); 2512 g_object_unref(G_OBJECT(pixbuf));
2513 g_object_unref(G_OBJECT(original)); 2513 g_object_unref(G_OBJECT(original));
2514 2514
2515 tmp = g_strdup_printf(_("The file '%s' is too large for %s. Please try a smaller image.\n"), 2515 tmp = g_strdup_printf(_("The file '%s' is too large for %s. Please try a smaller image.\n"),