proper resizing
This commit is contained in:
parent
58a72782d6
commit
973337efff
@ -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)
|
||||
img.save(image, quality=50, subsampling=2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user