remplace wand par pillow

This commit is contained in:
2022-07-06 16:47:55 +02:00
parent d3885805b3
commit c37b974fe7
2 changed files with 4 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
from flask import Blueprint, Flask, request, flash, render_template, url_for, session, redirect, abort, make_response, send_file, escape, flash, abort
from werkzeug.utils import secure_filename
from wand.image import Image
from PIL import Image
import time
import sqlite3
import os
@@ -29,8 +29,8 @@ def profile(username=None) :
nom = secure_filename(f.filename)
f.save(DOSSIER_PERSO + UTILISATEUR + '/profile/' + nom)
image = DOSSIER_PERSO + UTILISATEUR + '/profile/' + nom
with Image(filename = image) as img:
img.transform(resize='x80')
with Image.open(image) as img:
img.tumbnails(resize='80x80')
img.save(filename = DOSSIER_PERSO + UTILISATEUR + '/profile/' + nom)
imagelocation = DOSSIER_PERSO + UTILISATEUR + '/profile/' + nom
conn = sqlite3.connect('base.db') # Connexion à la base de donnée