我有4张引导卡,我正在使用卡img top使图像具有响应性。唯一的问题是图像大小不一,我使用AJAX将这些图像输入后端。 我想缩小图像的大小(高度和宽度),使其既具有响应性又具有固定长度
下面是我的上传视图,我一提交表单就给它打电话
@app.route('/', methods=['POST'])
def upload():
if 'photos[]' in request.files:
photos = request.files.getlist('photos[]')
photo = photos[0]
label = request.form["label"]
email = request.form["email"]
img_formate = "." + str(photo.filename).split(".")[-1]
image = label + img_formate
#i just want to resize image to width = 360 px and height to 300px
photo.save(os.path.join(app.config['UPLOAD_FOLDER'], image))
return " "
谢谢,@srikanth Chekuri帮助我
相关问题 更多 >
编程相关推荐