From 1b1413416fc4da77aa31a0f23da121746b1fd954 Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Thu, 29 May 2025 14:15:48 -0500 Subject: [PATCH] NCAA Baseball team logo fallback transparency --- src/ncaa_baseball_managers.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ncaa_baseball_managers.py b/src/ncaa_baseball_managers.py index e36bb7d4..728be995 100644 --- a/src/ncaa_baseball_managers.py +++ b/src/ncaa_baseball_managers.py @@ -58,11 +58,14 @@ class BaseNCAABaseballManager: try: logo_path = os.path.join(self.logo_dir, f"{team_abbr}.png") 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: logger.warning(f"[NCAABaseball] Logo not found for team {team_abbr}. Generating fallback.") - # Create a fallback image with the team abbreviation - image = Image.new('RGB', logo_size, color=(0, 0, 0)) + # Create a fallback image with the team abbreviation, ensure it's RGBA + image = Image.new('RGBA', logo_size, color=(0, 0, 0, 255)) # RGBA with full opacity draw = ImageDraw.Draw(image) # Attempt to use a small, clear font