diff --git a/ocarina/image.py b/ocarina/image.py index f3adeaad..951ed9d3 100644 --- a/ocarina/image.py +++ b/ocarina/image.py @@ -20,8 +20,10 @@ class Image(gtk.Image): h = buf.get_height() if h == new_h: return + if h == 0: + h = 1 new_w = (float(w) / float(h)) * new_h - if new_w>0 and new_h>0: + if new_w > 0 and new_h > 0: buf = buf.scale_simple(int(new_w), int(new_h), gtk.gdk.INTERP_HYPER) self.set_from_pixbuf(buf)