I am trying to resize an image:
from tkinter import filedialog
path = filedialog.askopenfilename(initialdir="C:\\Users\\josho\\Pictures", title="Choose a photo for your profile.", filetypes=(("png files", "*.png"),("jpg files", "*.jpg"), ("gif files", "*.gif")))
print(path)
limage = Image.open(path)
image = limage.resize((30,22), Image.ANTIALIAS)
limage2=ImageTk.PhotoImage(image)
Button69.config(image=limage)
limage.image()
But it flags up this error:
Traceback (most recent call last):
File "C:\Users\josho\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1892, in __call__
return self.func(*args)
File "C:\Users\josho\Documents\A Dream.py", line 30, in shadoe
Button69.config(image=limage)
File "C:\Users\josho\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1646, in configure
return self._configure('configure', cnf, kw)
File "C:\Users\josho\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1636, in _configure
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: image "<PIL.PngImagePlugin.PngImageFile image mode=RGB size=1152x648 at 0x264638D5970>" doesn't exist
help! pls im really desperate!