From eea03df8339cdda3846bfb462049056ffd84a7bb Mon Sep 17 00:00:00 2001 From: Justin Date: Fri, 14 Apr 2023 18:29:49 +0800 Subject: [PATCH] center user images when paused --- stockTicker.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/stockTicker.py b/stockTicker.py index bb7b2c6..723f5e4 100755 --- a/stockTicker.py +++ b/stockTicker.py @@ -4535,7 +4535,13 @@ class StockTicker(): img = self.openImage(os.path.join(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'user_uploads'), image)) img.thumbnail((99999, 32)) - + + if img.size[0] < 128: + diff = 128 - img.size[0] + new_image = Image.new('RGB',(128,32)) + new_image.paste(img,(64-int(img.size[0]/2),0)) + img = new_image + if all_settings['title'] and ind == 0: title_img = self.openImage('feature_titles/images.png') imgs.append(self.stitchImage([title_img, img]))