Generate thumbnails on the fly with PIL

Removed the need of having 3 copies of an image
Fixes more Sass(y) stuff
This commit is contained in:
Michał Gdula 2023-01-13 18:29:07 +00:00
parent 2455d3f88c
commit a10a5a8793
10 changed files with 149 additions and 76 deletions

View file

@ -25,7 +25,7 @@ def image(id):
# Get exif data from image
try:
file = Image.open(os.path.join(current_app.instance_path, current_app.config['UPLOAD_FOLDER'], 'original', image['file_name']))
file = Image.open(os.path.join(current_app.config['UPLOAD_FOLDER'], 'original', image['file_name']))
raw_exif = file.getexif()
human_exif = {}
@ -43,6 +43,7 @@ def image(id):
except:
# Cringe, no file present
human_exif = False
file = False
# All in le head
return render_template('image.html', image=image, exif=human_exif, file=file)