From 973337effface0db766bc9d3b6801d2ef7d2af5c Mon Sep 17 00:00:00 2001 From: Martin Quarda Date: Fri, 10 May 2024 22:55:05 +0200 Subject: [PATCH] proper resizing --- resize_photos.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resize_photos.py b/resize_photos.py index a72aab4..ed1c20a 100644 --- a/resize_photos.py +++ b/resize_photos.py @@ -7,7 +7,7 @@ for image in photos: print(image) img = PIL.Image.open(image) img.save(image.replace('.jpg', '.webp')) - ratio = 200/max(img.height, img.width) - img.resize((int(img.width * ratio), int(img.height * ratio))) + ratio = 400/max(img.height, img.width) + img = img.resize((int(img.width * ratio), int(img.height * ratio))) image = image.replace('photos/', 'photos/thumbnail/').replace('.jpg', '.webp') - img.save(image, quality=10, subsampling=2) \ No newline at end of file + img.save(image, quality=50, subsampling=2)