fixed GIF issue

This commit is contained in:
Justin 2022-06-14 15:25:58 +08:00 committed by GitHub
parent 98f2b82ed8
commit d001f5a28c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2795,25 +2795,25 @@ class StockTicker():
if ind == 0 and all_settings['title']:
title_img = self.openImage('feature_titles/gifs.png')
#title_img = self.openImage('feature_titles/gifs.png')
for i, frame in enumerate(ImageSequence.Iterator(GIF)):
frame = frame.convert('RGB')
frame.thumbnail((128, 32))
frame = frame.convert('P')
frame.thumbnail((128, 32),Image.NEAREST)
f = self.stitchImage([title_img, frame])
frames.append(f)
#f = self.stitchImage([title_img, frame])
frames.append(frame)
else:
for i, frame in enumerate(ImageSequence.Iterator(GIF)):
frame = frame.convert('RGB')
frame.thumbnail((128, 32))
frame = frame.convert('P')
frame.thumbnail((128, 32),Image.NEAREST)
#frame = frame.resize((99999, 32))
f = self.stitchImage([frame])
frames.append(f)
#f = self.stitchImage([frame])
frames.append(frame)
frames[0].save('./display_images/working_gif{}.gif'.format(str(ind)), save_all=True, append_images=frames[1:], loop=0, optimize = False)