From 26f1f7775a704e770aafe48778a702e4606e6fb6 Mon Sep 17 00:00:00 2001 From: zakary Date: Sat, 31 Aug 2024 22:32:00 -0500 Subject: [PATCH] [UI] Convert all ico to png format for tracker icon --- deluge/ui/tracker_icons.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/deluge/ui/tracker_icons.py b/deluge/ui/tracker_icons.py index d9e080a988..806d3cfd54 100644 --- a/deluge/ui/tracker_icons.py +++ b/deluge/ui/tracker_icons.py @@ -461,15 +461,12 @@ def resize_icon(self, icon): # Requires Pillow(PIL) to resize. if icon and Image: filename = icon.get_filename() - remove_old = False with Image.open(filename) as img: + new_filename = filename.rpartition('.')[0] + '.png' if img.size > (16, 16): - new_filename = filename.rpartition('.')[0] + '.png' img = img.resize((16, 16), Image.Resampling.LANCZOS) - img.save(new_filename) - if new_filename != filename: - remove_old = True - if remove_old: + img.save(new_filename) + if new_filename != filename: os.remove(filename) icon = TrackerIcon(new_filename) return icon