Skip to content

Commit

Permalink
badge.py: add png support
Browse files Browse the repository at this point in the history
  • Loading branch information
helgibbons committed Jun 21, 2024
1 parent 21e27e8 commit ae04ac9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions badger_os/examples/badge.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ def draw_badge():
display.set_pen(0)
display.clear()

if badge_image.endswith('.png' or '.PNG' or '.Png'):
try:
# Draw badge image
png.open_file(badge_image)
png.decode(WIDTH - IMAGE_WIDTH, 0)
else:
except (OSError, RuntimeError):
# Draw badge image
jpeg.open_file(badge_image)
jpeg.decode(WIDTH - IMAGE_WIDTH, 0)
Expand Down

0 comments on commit ae04ac9

Please sign in to comment.