wip: remove localconfig & start imagetools

This commit is contained in:
Yannik Schmidt
2024-02-25 18:47:02 +01:00
parent 991eb2284e
commit 7ae77b339d
2 changed files with 11 additions and 15 deletions

11
imagetools.py Normal file
View File

@@ -0,0 +1,11 @@
import PIL
def load_and_keep_aspect_rescale(path, target_x, target_y):
'''Load an image and resize it while keeping the aspect ratio (crop if it doesnt fit)'''
img = PIL.Image.open(path)
# get size
# img.size()
img = img.resize((x-2*30, y-2*30))
img = PIL.ImageTk.PhotoImage(img)