we can now disable avatars by setting width or height to 0. Partially fixes #1816
This commit is contained in:
parent
8ad5dec778
commit
29f41b223a
|
@ -1053,14 +1053,16 @@ class Interface:
|
||||||
path_to_original_file = path_to_file + '.' + typ
|
path_to_original_file = path_to_file + '.' + typ
|
||||||
pixbuf.save(path_to_original_file, typ)
|
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'
|
|
||||||
pixbuf = gtkgui_helpers.get_scaled_pixbuf(
|
pixbuf = gtkgui_helpers.get_scaled_pixbuf(
|
||||||
gtkgui_helpers.get_pixbuf_from_data(photo_decoded), 'notification')
|
gtkgui_helpers.get_pixbuf_from_data(photo_decoded), 'notification')
|
||||||
|
if pixbuf:
|
||||||
|
path_to_normal_file = path_to_file + '_notif_size_colored.png'
|
||||||
pixbuf.save(path_to_normal_file, 'png')
|
pixbuf.save(path_to_normal_file, 'png')
|
||||||
# Generate and save the resized, black and white avatar
|
# Generate and save the resized, black and white avatar
|
||||||
path_to_bw_file = path_to_file + '_notif_size_bw.png'
|
|
||||||
bwbuf = gtkgui_helpers.get_scaled_pixbuf(
|
bwbuf = gtkgui_helpers.get_scaled_pixbuf(
|
||||||
gtkgui_helpers.make_pixbuf_grayscale(pixbuf), 'notification')
|
gtkgui_helpers.make_pixbuf_grayscale(pixbuf), 'notification')
|
||||||
|
if bwbuf:
|
||||||
|
path_to_bw_file = path_to_file + '_notif_size_bw.png'
|
||||||
bwbuf.save(path_to_bw_file, 'png')
|
bwbuf.save(path_to_bw_file, 'png')
|
||||||
|
|
||||||
def add_event(self, account, jid, typ, args):
|
def add_event(self, account, jid, typ, args):
|
||||||
|
|
|
@ -224,7 +224,9 @@ class VcardWindow:
|
||||||
dialogs.ErrorDialog(_('Could not load image'), msg)
|
dialogs.ErrorDialog(_('Could not load image'), msg)
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
path_to_file = os.path.join(gajim.TMP, 'avatar_scaled.png')
|
if scaled_pixbuf:
|
||||||
|
path_to_file = os.path.join(gajim.TMP,
|
||||||
|
'avatar_scaled.png')
|
||||||
scaled_pixbuf.save(path_to_file, 'png')
|
scaled_pixbuf.save(path_to_file, 'png')
|
||||||
done = True
|
done = True
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue