center user gifs when paused

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

View File

@ -4636,7 +4636,11 @@ class StockTicker():
for i, frame in enumerate(ImageSequence.Iterator(GIF)):
frame = frame.convert('P')
frame.thumbnail((128, 32),Image.NEAREST)
if frame.size[0] < 128:
diff = 128 - frame.size[0]
new_image = Image.new('RGB',(128,32))
new_image.paste(frame,(64-int(frame.size[0]/2),0))
frame = new_image
#f = self.stitchImage([title_img, frame])
frames.append(frame)
@ -4646,7 +4650,11 @@ class StockTicker():
frame = frame.convert('P')
frame.thumbnail((128, 32),Image.NEAREST)
if frame.size[0] < 128:
diff = 128 - frame.size[0]
new_image = Image.new('RGB',(128,32))
new_image.paste(frame,(64-int(frame.size[0]/2),0))
frame = new_image
#frame = frame.resize((99999, 32))
#f = self.stitchImage([frame])
frames.append(frame)