Im currently using the code:
photo = Image.open('ImgSource').resize((x,y), Image.ANTIALIAS)
img = ImageTk.PhotoImage(photo)
where x and y are static dimensions, however my program uses multiple different image sizes and this code causes portrait rectangle images to appear stretched and squashed.
I have the image presented in a canvas as such:
canvas = tk.Canvas(self, background='grey')
canvas.grid(row=0, rowspan=2, column=1, columnspan=2, sticky=N+S+E+W)
...
canvas.create_image(150,150, image = img, anchor = 'center')
The remaining space in the grid/window is used by buttons.
Is there a way to perhaps scale down the image to fit inside the canvas/grid cell while still maintaining its original aspect ratio? I am very much a beginner at python so sorry if i've missed something or not given enough info.