Skip to content

Commit

Permalink
Catch malformatted gifs.
Browse files Browse the repository at this point in the history
  • Loading branch information
BonsaiDen committed May 3, 2010
1 parent e303840 commit e8f1b73
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions atarashii/usr/share/pyshared/atarashii/view_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,20 @@ def on_tooltip(self, icon, pos_x, pos_y, key, tip, *args):
URLExpander(link, self.expand_link)

def set_tooltip(self, user, img):
self.tooltip_img.show()
self.tooltip_label.set_markup(lang.html_avatar_tooltip \
% (escape(user.name), user.statuses_count,
user.followers_count, user.friends_count))

# Watch out for malformatted gifs, I'm looking at you @defunkt!
if img != self.tooltip_img_file:
buf = gtk.gdk.pixbuf_new_from_file_at_size(img, 48, 48)
self.tooltip_img.set_from_pixbuf(buf)
self.tooltip_img_file = img
try:
buf = gtk.gdk.pixbuf_new_from_file_at_size(img, 48, 48)
self.tooltip_img.set_from_pixbuf(buf)
self.tooltip_img_file = img

except:
self.tooltip_img.hide()


# Menu Events --------------------------------------------------------------
Expand Down

0 comments on commit e8f1b73

Please sign in to comment.