Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -77,15 +77,7 @@ def fill_rectangle_cropper1(img,padding):
|
|
77 |
return newimg
|
78 |
else:
|
79 |
return img
|
80 |
-
|
81 |
-
def on_submit():
|
82 |
-
padding_choice = padding_option.get()
|
83 |
-
if padding_choice == 1:
|
84 |
-
result_img = fill_rectangle_cropper(img, "top_bottom")
|
85 |
-
elif padding_choice == 2:
|
86 |
-
result_img = fill_rectangle_cropper(img, "left_right")
|
87 |
-
# Here you can save or display result_img
|
88 |
-
print("Padding applied based on selection!")
|
89 |
|
90 |
# Home Page
|
91 |
@app.get("/", response_class=HTMLResponse)
|
@@ -149,8 +141,8 @@ def home_page():
|
|
149 |
@app.get("/demo", response_class=HTMLResponse)
|
150 |
def demo_page():
|
151 |
# URLs for demo images
|
152 |
-
url1 = "https://raw.githubusercontent.com/webdevserv/images_video/main/
|
153 |
-
url2 = "https://raw.githubusercontent.com/webdevserv/images_video/main/
|
154 |
|
155 |
# Process the first image
|
156 |
response = requests.get(url1)
|
|
|
77 |
return newimg
|
78 |
else:
|
79 |
return img
|
80 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
# Home Page
|
83 |
@app.get("/", response_class=HTMLResponse)
|
|
|
141 |
@app.get("/demo", response_class=HTMLResponse)
|
142 |
def demo_page():
|
143 |
# URLs for demo images
|
144 |
+
url1 = "https://raw.githubusercontent.com/webdevserv/images_video/main/squareportrait.png"
|
145 |
+
url2 = "https://raw.githubusercontent.com/webdevserv/images_video/main/squarelandscape.png"
|
146 |
|
147 |
# Process the first image
|
148 |
response = requests.get(url1)
|