From 77f920641abbdda5b3e6d31630ad684e600cc8c9 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 29 Nov 2005 18:29:03 +0000 Subject: [PATCH] [multani] don't make avatars bigger than they are --- src/gtkgui_helpers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py index e3cd6648e..6b8ccd317 100644 --- a/src/gtkgui_helpers.py +++ b/src/gtkgui_helpers.py @@ -411,6 +411,10 @@ def get_scaled_pixbuf(pixbuf, type): # resize to a width / height for the avatar not to have distortion # (keep aspect ratio) + + if pixbuf.get_width() < gajim.config.get(type + '_avatar_width') and \ + pixbuf.get_height() < gajim.config.get(type + '_avatar_height'): + return pixbuf # we don't want to make avatar bigger ratio = float(pixbuf.get_width()) / float(pixbuf.get_height()) if ratio > 1: w = gajim.config.get(type + '_avatar_width')