catch and pass on exception of pixbufloader
This commit is contained in:
parent
fb40117581
commit
07fecda486
|
@ -192,9 +192,11 @@ class TabbedChatWindow(chat.Chat):
|
||||||
pass
|
pass
|
||||||
if img_decoded:
|
if img_decoded:
|
||||||
pixbufloader = gtk.gdk.PixbufLoader()
|
pixbufloader = gtk.gdk.PixbufLoader()
|
||||||
|
try:
|
||||||
pixbufloader.write(img_decoded)
|
pixbufloader.write(img_decoded)
|
||||||
pixbuf = pixbufloader.get_pixbuf()
|
pixbuf = pixbufloader.get_pixbuf()
|
||||||
pixbufloader.close()
|
pixbufloader.close()
|
||||||
|
|
||||||
scaled_buf = pixbuf.scale_simple(52, 52, gtk.gdk.INTERP_HYPER)
|
scaled_buf = pixbuf.scale_simple(52, 52, gtk.gdk.INTERP_HYPER)
|
||||||
x = None
|
x = None
|
||||||
if self.xmls.has_key(vcard['jid']):
|
if self.xmls.has_key(vcard['jid']):
|
||||||
|
@ -205,6 +207,8 @@ class TabbedChatWindow(chat.Chat):
|
||||||
image = x.get_widget('avatar_image')
|
image = x.get_widget('avatar_image')
|
||||||
image.set_from_pixbuf(scaled_buf)
|
image.set_from_pixbuf(scaled_buf)
|
||||||
image.show_all()
|
image.show_all()
|
||||||
|
except gobject.GError: # we may get "unknown image format"
|
||||||
|
pass
|
||||||
|
|
||||||
def set_state_image(self, jid):
|
def set_state_image(self, jid):
|
||||||
prio = 0
|
prio = 0
|
||||||
|
|
Loading…
Reference in New Issue