Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,12 +2,10 @@ import gradio as gr
|
|
| 2 |
from PIL import Image
|
| 3 |
|
| 4 |
def resize_image(image):
|
| 5 |
-
print(f"width:{image.width},height:{image.height}")
|
| 6 |
new_width=360
|
| 7 |
new_height=image.height*new_width//image.width
|
| 8 |
-
image = image.resize((new_width, new_height)
|
| 9 |
-
image
|
| 10 |
-
image.save("download.png", 'PNG', quality=95, dpi=[300,300], bits=1)
|
| 11 |
return "download.png"
|
| 12 |
|
| 13 |
iface = gr.Interface(fn=resize_image,
|
|
|
|
| 2 |
from PIL import Image
|
| 3 |
|
| 4 |
def resize_image(image):
|
|
|
|
| 5 |
new_width=360
|
| 6 |
new_height=image.height*new_width//image.width
|
| 7 |
+
image = image.resize((new_width, new_height))
|
| 8 |
+
image.save("download.png", 'PNG')
|
|
|
|
| 9 |
return "download.png"
|
| 10 |
|
| 11 |
iface = gr.Interface(fn=resize_image,
|