From f4a9ef54c6ba80843a591d539553cb4a76107998 Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 15 Aug 2023 23:46:51 +0800 Subject: [PATCH] Update stockTicker.py --- stockTicker.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/stockTicker.py b/stockTicker.py index b164c0e..2483dd6 100755 --- a/stockTicker.py +++ b/stockTicker.py @@ -7023,11 +7023,15 @@ class StockTicker(): midFrame = self.textToImageProf(ticker, current, change, arrow, font=ImageFont.load("./fonts/6x10.pil")) #IMAGE THE TEXT if sector_settings['logos']: try: - logos_path = os.path.join(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logos'), 'sector') - logo = Image.open(os.path.join(logos_path, category + '.png')) - # half the size of the logo - width, height = logo.size - logo = logo.resize((int(width/2), int(height/2))) + try: #load the tiny logo + logos_path = os.path.join(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logos'), 'tiny_sector') + logo = Image.open(os.path.join(logos_path, category + '.png')) + except: # load the big logo and scale it + logos_path = os.path.join(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logos'), 'sector') + logo = Image.open(os.path.join(logos_path, category + '.png')) + # half the size of the logo + width, height = logo.size + logo = logo.resize((int(width/2), int(height/2))) stitchedStock = self.stitchImage([logo,midFrame]) except Exception as e: stitchedStock = midFrame