Spaces:
Runtime error
Runtime error
Commit
β’
c29cb26
1
Parent(s):
e86dcb9
Update app.py
Browse files
app.py
CHANGED
@@ -251,7 +251,7 @@ def resize_image(image, output_size=(1024, 576)):
|
|
251 |
# Resize the image to match the target width, maintaining aspect ratio
|
252 |
new_width = output_size[0]
|
253 |
new_height = int(new_width / image_aspect)
|
254 |
-
resized_image = image.resize((new_width, new_height), Image.
|
255 |
# Calculate coordinates for cropping
|
256 |
left = 0
|
257 |
top = (new_height - output_size[1]) / 2
|
|
|
251 |
# Resize the image to match the target width, maintaining aspect ratio
|
252 |
new_width = output_size[0]
|
253 |
new_height = int(new_width / image_aspect)
|
254 |
+
resized_image = image.resize((new_width, new_height), Image.Resampling.LANCZOS)
|
255 |
# Calculate coordinates for cropping
|
256 |
left = 0
|
257 |
top = (new_height - output_size[1]) / 2
|