[multani] don't make avatars bigger than they are

This commit is contained in:
Yann Leboulanger 2005-11-29 18:29:03 +00:00
parent 5406f2c3c6
commit 77f920641a
1 changed files with 4 additions and 0 deletions

View File

@ -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')