I set Flask images to resize some images. My code is as follows:
<img src = '{{url_for('showimages', filename = market.thumbnail, width=100, height=100, mode='crop')}}'>
showimages :
@app.route('/image/user/<filename>') def showthumbnail(filename): return send_from_directory(app.config['UPLOAD_FOLDER'], filename)
Nothing happens, and my Chrome devaloper tools display the image URL as follows:
<img src="/image/user/Untitled-1.png?width=100&height=100&mode=crop">
I know that there is another way instead of url_for - resized_img_src() . I set IMAGES_PATH= os.path.join(APP_ROOT, 'images/') . However, this configuration does not work, and when I use resized_img_src (), only the icon with the damaged image appears. I do not know how to fix this.
+ Are there any other ways to resize uploaded images?
source share