Skip to content

Commit

Permalink
Resize loaded icons (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt authored Jul 5, 2023
1 parent 0ddbefa commit a8fd4fe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions home_assistant_streamdeck_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,9 @@ def _init_icon(
# Convert to RGB if needed
if icon.mode != "RGB":
icon = icon.convert("RGB")
if icon.size != size:
# Resize image to the correct resolution if needed
icon = icon.resize(size, Image.ANTIALIAS)
return icon
if icon_mdi is not None:
assert icon_mdi_margin is not None
Expand Down

0 comments on commit a8fd4fe

Please sign in to comment.