width and height must be integer
This commit is contained in:
parent
9498889fa0
commit
6df1018fca
1 changed files with 3 additions and 2 deletions
|
@ -255,13 +255,14 @@ class TabbedChatWindow(chat.Chat):
|
||||||
scaled_buf = None
|
scaled_buf = None
|
||||||
else:
|
else:
|
||||||
pixbuf = self.plugin.avatar_pixbufs[jid]
|
pixbuf = self.plugin.avatar_pixbufs[jid]
|
||||||
|
# compute width / height of the avatar without distorting it
|
||||||
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('avatar_width')
|
w = gajim.config.get('avatar_width')
|
||||||
h = w/ratio
|
h = int(w/ratio)
|
||||||
else:
|
else:
|
||||||
h = gajim.config.get('avatar_height')
|
h = gajim.config.get('avatar_height')
|
||||||
w = h*ratio
|
w = int(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…
Add table
Reference in a new issue