python - 旋转的图片不显示在烧瓶中
问题描述
原始图片上传并存储在一个目录中,然后显示在一个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)
问题是在文件资源管理器中图片正确转动,在烧瓶网页中它仍然加载为原始图片。
感谢您的帮助
解决方案
您是否重新启动了 Flask 应用程序?清除浏览器的缓存也可以。
推荐阅读
- tcl - Profiling TCL/TK information explanation
- python - Reversing a negative number in Python
- javascript - how function numberIterator
- c++ - 发送矢量的最快方法是什么
> 从 x86 平台中创建的一个进程到 x64 中构建的另一个进程 - java - 使代码在执行的操作中从同一位置继续
- microsoft-cognitive - 从图像存储中匹配图像的认知服务?
- javascript - Terminate a function whenever it is executed - Javascript
- c# - asp.net core 2.0 模型验证不验证数据
- java - 使用 Java 中的 Geotools 检索 WFS 地图内容
- r - 使用 R/plotly 在轴标题中写入符号摄氏度