Fix NHL logo pasting in NHLLiveManager - Remove incorrect use of temp_draw.im.paste() - Use proper Image.paste() method for logo compositing - Fix alpha channel handling in logo pasting

This commit is contained in:
ChuckBuilds
2025-04-18 10:50:39 -05:00
parent f6a771c5a4
commit f84cb4ce89

View File

@@ -166,8 +166,8 @@ class BaseNHLManager:
home_y = self.display_height // 4 - home_logo.height // 2
temp_img = Image.new('RGB', (self.display_width, self.display_height), 'black')
temp_draw = ImageDraw.Draw(temp_img)
temp_draw.im.paste(home_logo, (home_x, home_y), home_logo)
draw.im.paste(temp_img, (0, 0))
temp_img.paste(home_logo, (home_x, home_y), home_logo)
img.paste(temp_img, (0, 0))
# Draw away team logo
if away_logo:
@@ -175,8 +175,8 @@ class BaseNHLManager:
away_y = 3 * self.display_height // 4 - away_logo.height // 2
temp_img = Image.new('RGB', (self.display_width, self.display_height), 'black')
temp_draw = ImageDraw.Draw(temp_img)
temp_draw.im.paste(away_logo, (away_x, away_y), away_logo)
draw.im.paste(temp_img, (0, 0))
temp_img.paste(away_logo, (away_x, away_y), away_logo)
img.paste(temp_img, (0, 0))
# Draw scores
home_score = str(self.current_game["home_score"])
@@ -293,8 +293,8 @@ class NHLLiveManager(BaseNHLManager):
home_y = self.display_height // 4 - home_logo.height // 2
temp_img = Image.new('RGB', (self.display_width, self.display_height), 'black')
temp_draw = ImageDraw.Draw(temp_img)
temp_draw.im.paste(home_logo, (home_x, home_y), home_logo)
draw.im.paste(temp_img, (0, 0))
temp_img.paste(home_logo, (home_x, home_y), home_logo)
img.paste(temp_img, (0, 0))
# Draw away team logo
if away_logo:
@@ -302,8 +302,8 @@ class NHLLiveManager(BaseNHLManager):
away_y = 3 * self.display_height // 4 - away_logo.height // 2
temp_img = Image.new('RGB', (self.display_width, self.display_height), 'black')
temp_draw = ImageDraw.Draw(temp_img)
temp_draw.im.paste(away_logo, (away_x, away_y), away_logo)
draw.im.paste(temp_img, (0, 0))
temp_img.paste(away_logo, (away_x, away_y), away_logo)
img.paste(temp_img, (0, 0))
# Draw scores
home_score = str(self.current_game["home_score"])