Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -129,6 +129,7 @@ def demo_page():
|
|
| 129 |
<link rel="stylesheet" href="/static/styles/style.css">
|
| 130 |
</head>
|
| 131 |
<body>
|
|
|
|
| 132 |
<h2>Square Image Demo</h2>
|
| 133 |
<p>Image will be squared with color filler where applicable.</p>
|
| 134 |
<h3>Result 1:</h3>
|
|
@@ -191,12 +192,20 @@ async def upload_file(file: UploadFile = File(...)):
|
|
| 191 |
# Return the HTML response
|
| 192 |
return HTMLResponse(
|
| 193 |
content=f"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 194 |
<img src="/static/images/banner.jpg" alt="Banner" width="100%">
|
| 195 |
<h2>Image successfully squared!</h2>
|
| 196 |
<img src='data:image/jpeg;base64,{display_encoded_img}' width="512" height="512" />
|
| 197 |
<p><a href="data:image/jpeg;base64,{full_size_encoded_img}" download="squared_image.jpg">
|
| 198 |
Download Full-Size Image</a></p>
|
| 199 |
<p><a href="/">Back</a></p>
|
|
|
|
|
|
|
| 200 |
""",
|
| 201 |
media_type="text/html"
|
| 202 |
)
|
|
|
|
| 129 |
<link rel="stylesheet" href="/static/styles/style.css">
|
| 130 |
</head>
|
| 131 |
<body>
|
| 132 |
+
<img src="/static/images/banner.jpg" alt="Banner" width="100%">
|
| 133 |
<h2>Square Image Demo</h2>
|
| 134 |
<p>Image will be squared with color filler where applicable.</p>
|
| 135 |
<h3>Result 1:</h3>
|
|
|
|
| 192 |
# Return the HTML response
|
| 193 |
return HTMLResponse(
|
| 194 |
content=f"""
|
| 195 |
+
<html>
|
| 196 |
+
<head>
|
| 197 |
+
<title>Part of Idoia's Developer Portfolio - Innovating the Web</title>
|
| 198 |
+
<link rel="stylesheet" href="/static/styles/style.css">
|
| 199 |
+
</head>
|
| 200 |
+
<body>
|
| 201 |
<img src="/static/images/banner.jpg" alt="Banner" width="100%">
|
| 202 |
<h2>Image successfully squared!</h2>
|
| 203 |
<img src='data:image/jpeg;base64,{display_encoded_img}' width="512" height="512" />
|
| 204 |
<p><a href="data:image/jpeg;base64,{full_size_encoded_img}" download="squared_image.jpg">
|
| 205 |
Download Full-Size Image</a></p>
|
| 206 |
<p><a href="/">Back</a></p>
|
| 207 |
+
</body>
|
| 208 |
+
</html>
|
| 209 |
""",
|
| 210 |
media_type="text/html"
|
| 211 |
)
|