when contact has a non jpeg/png avatar, save it as png so that tooltip can show it
This commit is contained in:
parent
693270cf5b
commit
3a1e5c579d
1 changed files with 5 additions and 5 deletions
10
src/gajim.py
10
src/gajim.py
|
@ -913,11 +913,11 @@ class Interface:
|
||||||
path_to_file = os.path.join(gajim.AVATAR_PATH, jid)
|
path_to_file = os.path.join(gajim.AVATAR_PATH, jid)
|
||||||
pixbuf, typ = gtkgui_helpers.get_pixbuf_from_data(photo_decoded,
|
pixbuf, typ = gtkgui_helpers.get_pixbuf_from_data(photo_decoded,
|
||||||
want_type = True)
|
want_type = True)
|
||||||
if typ in ('jpeg', 'png'):
|
if typ not in ('jpeg', 'png'):
|
||||||
path_to_original_file = path_to_file + '.' + typ
|
gajim.log.debug('gtkpixbuf cannot save other than jpeg and png formats. saving %s\'avatar as png file (originaly %s)' % (jid, typ))
|
||||||
pixbuf.save(path_to_original_file, typ)
|
typ = 'png'
|
||||||
else:
|
path_to_original_file = path_to_file + '.' + typ
|
||||||
gajim.log.debug('gtkpixbuf cannot save other than jpeg and png formats. skipping avatar of %s' % jid)
|
pixbuf.save(path_to_original_file, typ)
|
||||||
# Generate and save the resized, color avatar
|
# Generate and save the resized, color avatar
|
||||||
path_to_normal_file = path_to_file + '_notif_size_colored.png'
|
path_to_normal_file = path_to_file + '_notif_size_colored.png'
|
||||||
pixbuf = gtkgui_helpers.get_scaled_pixbuf(
|
pixbuf = gtkgui_helpers.get_scaled_pixbuf(
|
||||||
|
|
Loading…
Add table
Reference in a new issue