remplace wand par pillow
This commit is contained in:
		
							parent
							
								
									d3885805b3
								
							
						
					
					
						commit
						c37b974fe7
					
				@ -11,8 +11,7 @@ pkg_add py3-werkzeug py3-jinja2 py3-Pillow py3-wtforms py3-flask-wtf py3-flask \
 | 
			
		||||
py3-bcrypt py3-markdown
 | 
			
		||||
 | 
			
		||||
### Sur Debian
 | 
			
		||||
 apt install truc_much
 | 
			
		||||
 | 
			
		||||
 apt install python3-flask python3-flask-bcrypt python3-wtforms python3-pil python3-markdown
 | 
			
		||||
### Ensuite dans le dossier du projet tu fais :
 | 
			
		||||
 | 
			
		||||
    $ export FLASK_APP=pywallter.py
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user