Geek7 commited on
Commit
e247e6b
·
verified ·
1 Parent(s): e349159

Update myapp.py

Browse files
Files changed (1) hide show
  1. myapp.py +2 -2
myapp.py CHANGED
@@ -17,13 +17,13 @@ def upscale_image():
17
  return jsonify({"error": "No image provided"}), 400
18
 
19
  input_image = request.files['image'].read() # Read the uploaded image
20
- width = int(request.form.get('width', 2)) # Default upscale factor
21
  height = int(request.form.get('height', 2))
22
 
23
  # Open the image using PIL
24
  img = Image.open(io.BytesIO(input_image))
25
 
26
- # Resize the image to upscale (you can adjust the method as needed)
27
  upscaled_img = img.resize((img.width * width, img.height * height), Image.LANCZOS)
28
 
29
  # Save to bytes
 
17
  return jsonify({"error": "No image provided"}), 400
18
 
19
  input_image = request.files['image'].read() # Read the uploaded image
20
+ width = int(request.form.get('width', 2)) # User-specified upscale factor
21
  height = int(request.form.get('height', 2))
22
 
23
  # Open the image using PIL
24
  img = Image.open(io.BytesIO(input_image))
25
 
26
+ # Resize the image using user-defined width and height
27
  upscaled_img = img.resize((img.width * width, img.height * height), Image.LANCZOS)
28
 
29
  # Save to bytes