Skip to content

Commit

Permalink
[UI] Convert all ico to png format for tracker icon
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkarry committed Sep 8, 2024
1 parent c88f750 commit 9af5daf
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions deluge/ui/tracker_icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9af5daf

Please sign in to comment.