Spaces:
Sleeping
Sleeping
artificialguybr
commited on
Commit
•
4dd1c8f
1
Parent(s):
28050f6
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ import io
|
|
9 |
|
10 |
def resize_image(image_path, max_size=(800, 800), quality=85):
|
11 |
with Image.open(image_path) as img:
|
12 |
-
img.thumbnail(max_size, Image.
|
13 |
buffer = io.BytesIO()
|
14 |
img.save(buffer, format="JPEG", quality=quality)
|
15 |
return buffer.getvalue()
|
|
|
9 |
|
10 |
def resize_image(image_path, max_size=(800, 800), quality=85):
|
11 |
with Image.open(image_path) as img:
|
12 |
+
img.thumbnail(max_size, Image.Resampling.LANCZOS)
|
13 |
buffer = io.BytesIO()
|
14 |
img.save(buffer, format="JPEG", quality=quality)
|
15 |
return buffer.getvalue()
|