center user images when paused

This commit is contained in:
Justin 2023-04-14 18:29:49 +08:00 committed by GitHub
parent 8ab7361a57
commit eea03df833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 = self.openImage(os.path.join(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'user_uploads'), image))
img.thumbnail((99999, 32)) 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: if all_settings['title'] and ind == 0:
title_img = self.openImage('feature_titles/images.png') title_img = self.openImage('feature_titles/images.png')
imgs.append(self.stitchImage([title_img, img])) imgs.append(self.stitchImage([title_img, img]))