A part of the input image is cut off when displaying via canvas.create_image in a tkinter window
I have tried to change the "side" parameters and the width / height values in the canvas.create_image object.
here is my code and input image:
import tkinter as tk
from tkinter import *
from tkinter.filedialog import askopenfilename
import os
from PIL import ImageTk, Image
def show_values():
print(slider1.get())
window = tk.Tk()
filename = askopenfilename() # show an "Open" dialog box and return the path to the selected file
print(filename)
slider1 = Scale(window, from_=0, to=42, orient='vertical')
slider1.pack(side=LEFT)
canvas = Canvas(window)
canvas.pack()
img = ImageTk.PhotoImage(Image.open(filename))
imageWidth = img.width()
imageHeight = img.height()
canvas.create_image(imageWidth + 1, imageHeight + 1, image=img)
canvas.pack(side=RIGHT)
Button(window, text='Process Image', command=show_values).pack(side=BOTTOM)
window.mainloop()