【发布时间】:2020-06-04 02:54:09
【问题描述】:
原始图片上传并存储在一个目录中,然后显示在一个html页面中。路线是
@mod.route('/profile', methods=['GET'])
@login_required
def profile():
form = UpdateProfileForm()
if request.method == 'GET':
form.username.data = current_user.username
form.country.data = Paises.query.all()
form.telephone.data = current_user.telephone
image_file = url_for('static', filename='profile_pics/' + current_user.image_file)
return render_template('profile.html', form=form, image_file=image_file)
当一个旋转90度的按钮驻留时,它在网页中显示图片。下图也显示了目录中的图片
图片翻转按钮调用路线及功能是
path = 'static/profile_pics/'+filename
i = Image.open(path)
y, z = i.size
i2 = i.rotate(90, expand=1)
i2.save(path)
问题是在文件资源管理器中图片正确转动,在烧瓶网页中仍然加载为原始图片。
感谢您的帮助
【问题讨论】:
标签: python html python-3.x flask flask-sqlalchemy