[multani] don't make avatars bigger than they are
This commit is contained in:
parent
5406f2c3c6
commit
77f920641a
|
@ -411,6 +411,10 @@ def get_scaled_pixbuf(pixbuf, type):
|
||||||
|
|
||||||
# resize to a width / height for the avatar not to have distortion
|
# resize to a width / height for the avatar not to have distortion
|
||||||
# (keep aspect ratio)
|
# (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())
|
ratio = float(pixbuf.get_width()) / float(pixbuf.get_height())
|
||||||
if ratio > 1:
|
if ratio > 1:
|
||||||
w = gajim.config.get(type + '_avatar_width')
|
w = gajim.config.get(type + '_avatar_width')
|
||||||
|
|
Loading…
Reference in New Issue