Recently I am working on a project text editor using Tkinter library of Python. I tried to make a function to insert image in text area.
def insertImage():
select_image = filedialog.askopenfilename(title="Select your image",filetypes=[("Image Files", "*.png"), ("Image Files", "*.jpg")])
global img
img = ImageTk.PhotoImage(file=select_image)
content_text.image_create(END, image=img)
It works fine when I tried to insert first image but when I insert the second image in Editor, the first image become invisible or white
I have imported all necessary libraries like tkinter, filedialog, PIL,etc. Can you please tell what are the problem in my code or could provide the correct solution. Thanks in Advance!!