[Kaleo] don't make rectangulare avatars become square
This commit is contained in:
parent
95ad04abfb
commit
d505fd01a0
|
@ -255,8 +255,13 @@ class TabbedChatWindow(chat.Chat):
|
||||||
scaled_buf = None
|
scaled_buf = None
|
||||||
else:
|
else:
|
||||||
pixbuf = self.plugin.avatar_pixbufs[jid]
|
pixbuf = self.plugin.avatar_pixbufs[jid]
|
||||||
|
ratio = float(pixbuf.get_width()) / float(pixbuf.get_height())
|
||||||
|
if ratio > 1:
|
||||||
w = gajim.config.get('avatar_width')
|
w = gajim.config.get('avatar_width')
|
||||||
|
h = w/ratio
|
||||||
|
else:
|
||||||
h = gajim.config.get('avatar_height')
|
h = gajim.config.get('avatar_height')
|
||||||
|
w = h*ratio
|
||||||
scaled_buf = pixbuf.scale_simple(w, h, gtk.gdk.INTERP_HYPER)
|
scaled_buf = pixbuf.scale_simple(w, h, gtk.gdk.INTERP_HYPER)
|
||||||
|
|
||||||
image = xml.get_widget('avatar_image')
|
image = xml.get_widget('avatar_image')
|
||||||
|
|
Loading…
Reference in New Issue