We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8867da9 commit 3820511Copy full SHA for 3820511
deluge/ui/tracker_icons.py
@@ -461,15 +461,12 @@ def resize_icon(self, icon):
461
# Requires Pillow(PIL) to resize.
462
if icon and Image:
463
filename = icon.get_filename()
464
- remove_old = False
465
with Image.open(filename) as img:
+ new_filename = filename.rpartition('.')[0] + '.png'
466
if img.size > (16, 16):
467
- new_filename = filename.rpartition('.')[0] + '.png'
468
img = img.resize((16, 16), Image.Resampling.LANCZOS)
469
- img.save(new_filename)
470
- if new_filename != filename:
471
- remove_old = True
472
- if remove_old:
+ img.save(new_filename)
+ if new_filename != filename:
473
os.remove(filename)
474
icon = TrackerIcon(new_filename)
475
return icon
0 commit comments