mirror of
https://github.com/csd4ni3l/grass_touching_captcha.git
synced 2026-01-01 12:33:45 +01:00
fix image resizing requiring 2 paths instead of 1
This commit is contained in:
6
main.py
6
main.py
@@ -47,12 +47,12 @@ def register():
|
||||
|
||||
return f"Username: {username}\nPassword: {password}"
|
||||
|
||||
def resize_image_file(input_path, output_path, max_side=384, fmt="JPEG"):
|
||||
img = Image.open(input_path)
|
||||
def resize_image_file(path, max_side=384, fmt="JPEG"):
|
||||
img = Image.open(path)
|
||||
scale = max_side / max(img.size)
|
||||
if scale < 1:
|
||||
img = img.resize((int(img.width * scale), int(img.height * scale)), Image.LANCZOS)
|
||||
img.save(output_path, format=fmt)
|
||||
img.save(path, format=fmt)
|
||||
|
||||
@app.route("/upload", methods=["POST"])
|
||||
def upload():
|
||||
|
||||
Reference in New Issue
Block a user