Update app.py
Browse files
app.py
CHANGED
@@ -88,6 +88,7 @@ def home_page():
|
|
88 |
</script>
|
89 |
</head>
|
90 |
<body>
|
|
|
91 |
<img class="banner" src="/static/images/banner.jpg" alt="Banner" width="100%">
|
92 |
<h2>Square and Fill Image App</h2>
|
93 |
<p>Please select an option below:</p>
|
@@ -95,6 +96,7 @@ def home_page():
|
|
95 |
<li><a href="/demo">Demo</a></li>
|
96 |
<li><a href="/application">Application</a></li>
|
97 |
</ul>
|
|
|
98 |
</body>
|
99 |
</html>
|
100 |
"""
|
@@ -129,6 +131,7 @@ def demo_page():
|
|
129 |
<link rel="stylesheet" href="/static/styles/style.css">
|
130 |
</head>
|
131 |
<body>
|
|
|
132 |
<img class="banner" 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>
|
@@ -137,6 +140,7 @@ def demo_page():
|
|
137 |
<h3>Result 2:</h3>
|
138 |
<img src="data:image/jpeg;base64,{encoded_img2}" />
|
139 |
<p><a href="/">Back</a></p>
|
|
|
140 |
</body>
|
141 |
</html>
|
142 |
"""
|
@@ -151,6 +155,7 @@ def application_page():
|
|
151 |
<link rel="stylesheet" href="/static/styles/style.css">
|
152 |
</head>
|
153 |
<body>
|
|
|
154 |
<img class="banner" src="/static/images/banner.jpg" alt="Banner" width="100%">
|
155 |
<h2>Square Image Application</h2>
|
156 |
<p>Upload a JPG or PNG image to square and fill with color padding.</p>
|
@@ -159,6 +164,7 @@ def application_page():
|
|
159 |
<input type="submit" value="Square It">
|
160 |
</form>
|
161 |
<a href="/">Back</a>
|
|
|
162 |
</body>
|
163 |
</html>
|
164 |
"""
|
@@ -198,12 +204,14 @@ async def upload_file(file: UploadFile = File(...)):
|
|
198 |
<link rel="stylesheet" href="/static/styles/style.css">
|
199 |
</head>
|
200 |
<body>
|
|
|
201 |
<img class="banner" 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 |
""",
|
|
|
88 |
</script>
|
89 |
</head>
|
90 |
<body>
|
91 |
+
<div>
|
92 |
<img class="banner" src="/static/images/banner.jpg" alt="Banner" width="100%">
|
93 |
<h2>Square and Fill Image App</h2>
|
94 |
<p>Please select an option below:</p>
|
|
|
96 |
<li><a href="/demo">Demo</a></li>
|
97 |
<li><a href="/application">Application</a></li>
|
98 |
</ul>
|
99 |
+
</div>
|
100 |
</body>
|
101 |
</html>
|
102 |
"""
|
|
|
131 |
<link rel="stylesheet" href="/static/styles/style.css">
|
132 |
</head>
|
133 |
<body>
|
134 |
+
<div>
|
135 |
<img class="banner" src="/static/images/banner.jpg" alt="Banner" width="100%">
|
136 |
<h2>Square Image Demo</h2>
|
137 |
<p>Image will be squared with color filler where applicable.</p>
|
|
|
140 |
<h3>Result 2:</h3>
|
141 |
<img src="data:image/jpeg;base64,{encoded_img2}" />
|
142 |
<p><a href="/">Back</a></p>
|
143 |
+
</div>
|
144 |
</body>
|
145 |
</html>
|
146 |
"""
|
|
|
155 |
<link rel="stylesheet" href="/static/styles/style.css">
|
156 |
</head>
|
157 |
<body>
|
158 |
+
<div>
|
159 |
<img class="banner" src="/static/images/banner.jpg" alt="Banner" width="100%">
|
160 |
<h2>Square Image Application</h2>
|
161 |
<p>Upload a JPG or PNG image to square and fill with color padding.</p>
|
|
|
164 |
<input type="submit" value="Square It">
|
165 |
</form>
|
166 |
<a href="/">Back</a>
|
167 |
+
</div>
|
168 |
</body>
|
169 |
</html>
|
170 |
"""
|
|
|
204 |
<link rel="stylesheet" href="/static/styles/style.css">
|
205 |
</head>
|
206 |
<body>
|
207 |
+
<div>
|
208 |
<img class="banner" src="/static/images/banner.jpg" alt="Banner" width="100%">
|
209 |
<h2>Image successfully squared!</h2>
|
210 |
<img src='data:image/jpeg;base64,{display_encoded_img}' width="512" height="512" />
|
211 |
<p><a href="data:image/jpeg;base64,{full_size_encoded_img}" download="squared_image.jpg">
|
212 |
Download Full-Size Image</a></p>
|
213 |
<p><a href="/">Back</a></p>
|
214 |
+
</div>
|
215 |
</body>
|
216 |
</html>
|
217 |
""",
|