AItool commited on
Commit
0faec7c
·
verified ·
1 Parent(s): 44a8ab0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -210,11 +210,12 @@ def application_page():
210
  """
211
 
212
  @app.post("/upload/")
213
- async def upload_file(file: UploadFile = File(...)):
214
  try:
215
  # Await file upload
216
  contents = await file.read()
217
  img = Image.open(BytesIO(contents)).convert("RGB")
 
218
  rectangled_img = fill_rectangle_cropper(img,padding_type)
219
 
220
  # Save the rectangle image (original size)
 
210
  """
211
 
212
  @app.post("/upload/")
213
+ async def upload_file(file: UploadFile = File(...), padding_type: str = Form(...)):
214
  try:
215
  # Await file upload
216
  contents = await file.read()
217
  img = Image.open(BytesIO(contents)).convert("RGB")
218
+ # Apply padding based on user's choice
219
  rectangled_img = fill_rectangle_cropper(img,padding_type)
220
 
221
  # Save the rectangle image (original size)