If I pass 'fileimg' directly to the PhotoImage(file = fileimg), I'm getting error ( no such file ). So my thought was first to store it in 'memory' and then pass it to photoimage :|
With print(type(content),content) it will read the image in bytes <class 'bytes'>. Content suppose to be the Image file that I open it with filedialog. I have only 1-2 months expirence with python, I'm not sure if I can find the solution by myself.
Update:
img = PhotoImage(content)
now is not taking the image from file, but I'm getting another TypeError.
#TypeError: __str__ returned non-string (type bytes)
#<class 'tkinter.PhotoImage'>
With print(type(content),content) it will read the image in bytes <class 'bytes'>. Content suppose to be the Image file that I open it with filedialog. I have only 1-2 months expirence with python, I'm not sure if I can find the solution by myself.
Update:
img = PhotoImage(content)
now is not taking the image from file, but I'm getting another TypeError.
#TypeError: __str__ returned non-string (type bytes)
#<class 'tkinter.PhotoImage'>
(Oct-28-2020, 08:11 PM)deanhystad Wrote: PhotoImage asks for a file. Why are you reading the file and passing the contents?