mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-12 21:43:00 +00:00
NCAA Baseball team logo fallback transparency
This commit is contained in:
@@ -58,11 +58,14 @@ class BaseNCAABaseballManager:
|
|||||||
try:
|
try:
|
||||||
logo_path = os.path.join(self.logo_dir, f"{team_abbr}.png")
|
logo_path = os.path.join(self.logo_dir, f"{team_abbr}.png")
|
||||||
if os.path.exists(logo_path):
|
if os.path.exists(logo_path):
|
||||||
return Image.open(logo_path)
|
img = Image.open(logo_path)
|
||||||
|
if img.mode != 'RGBA':
|
||||||
|
img = img.convert('RGBA')
|
||||||
|
return img
|
||||||
else:
|
else:
|
||||||
logger.warning(f"[NCAABaseball] Logo not found for team {team_abbr}. Generating fallback.")
|
logger.warning(f"[NCAABaseball] Logo not found for team {team_abbr}. Generating fallback.")
|
||||||
# Create a fallback image with the team abbreviation
|
# Create a fallback image with the team abbreviation, ensure it's RGBA
|
||||||
image = Image.new('RGB', logo_size, color=(0, 0, 0))
|
image = Image.new('RGBA', logo_size, color=(0, 0, 0, 255)) # RGBA with full opacity
|
||||||
draw = ImageDraw.Draw(image)
|
draw = ImageDraw.Draw(image)
|
||||||
|
|
||||||
# Attempt to use a small, clear font
|
# Attempt to use a small, clear font
|
||||||
|
|||||||
Reference in New Issue
Block a user