From 30f7f7bea82c2f7c9a354e394d3cf78d2a1b6c8b Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Fri, 7 Apr 2006 19:03:38 +0000 Subject: [PATCH] don't rescale image when size is < 1 --- src/gtkgui_helpers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py index eed80e31c..3f1ecf2e7 100644 --- a/src/gtkgui_helpers.py +++ b/src/gtkgui_helpers.py @@ -401,13 +401,15 @@ def _get_fade_color(treeview, selected, focused): int(bg.blue*p + fg.blue*q)) def get_scaled_pixbuf(pixbuf, kind): - '''returns scaled pixbuf, keeping ratio etc + '''returns scaled pixbuf, keeping ratio etc or None kind is either "chat" or "roster" or "notification" or "tooltip"''' # resize to a width / height for the avatar not to have distortion # (keep aspect ratio) width = gajim.config.get(kind + '_avatar_width') height = gajim.config.get(kind + '_avatar_height') + if width < 1 or height < 1: + return None # Pixbuf size pix_width = pixbuf.get_width()