I create a GUI application with gif inside. However, during the course of the work, the gif begins to fail.
from tkinter import *
import time
import os
root = Tk()
frames = []
for i in range(61):
frames.append(PhotoImage(file='bell.gif', format='gif -index ' + str(i)))
def update(ind):
try:
frame = frames[ind]
except IndexError:
ind = 1
frame = frames[ind]
ind += 1
label.configure(image=frame, bg="white")
label.pack()
root.after(100, update, ind)
label = Label(root, bg="white")
root.after(100, update(1))
root.mainloop()
Here is the original gif: https://im4.ezgif.com/tmp/ezgif-4-e5132d340f75.gif
And what happens at the end: https://s3.gifyu.com/images/glitch9af7397783b31f35.gif