remove redundant parentheses

This commit is contained in:
Sanster 2022-03-27 13:20:56 +08:00
parent ad0c68164d
commit 0cc17ea322

View File

@ -103,8 +103,8 @@ def index():
def set_input_photo(): def set_input_photo():
if input_image: if input_image:
input_file = os.path.join(os.path.dirname(__file__), input_image) input_file = os.path.join(os.path.dirname(__file__), input_image)
if (os.path.exists(input_file)): # Check if file exists if os.path.exists(input_file): # Check if file exists
if (imghdr.what(input_file) is not None): # Check if file is image if imghdr.what(input_file) is not None: # Check if file is image
with open(input_file, 'rb') as f: with open(input_file, 'rb') as f:
image_in_bytes = f.read() image_in_bytes = f.read()
return send_file(io.BytesIO(image_in_bytes), mimetype='image/jpeg') return send_file(io.BytesIO(image_in_bytes), mimetype='image/jpeg')