diff --git a/cao_sunyata/static/img/cortex-auditif.png b/cao_sunyata/static/img/cortex-auditif.png index f8528de..7140064 100644 Binary files a/cao_sunyata/static/img/cortex-auditif.png and b/cao_sunyata/static/img/cortex-auditif.png differ diff --git a/cao_sunyata/static/img/cortex-visuel.png b/cao_sunyata/static/img/cortex-visuel.png index c517fc3..023e0d2 100644 Binary files a/cao_sunyata/static/img/cortex-visuel.png and b/cao_sunyata/static/img/cortex-visuel.png differ diff --git a/cao_sunyata/views/default.py b/cao_sunyata/views/default.py index c9f69ef..65b647d 100644 --- a/cao_sunyata/views/default.py +++ b/cao_sunyata/views/default.py @@ -390,25 +390,25 @@ def images(request): return HTTPFound(location=request.route_url('images')) # Finally write the data to a temporary file - temp_file_path = os.path.join(folder_path, input_name) + temp_file = os.path.join(folder_path, input_name) # supprimer le fichier s'il existe déjà - if os.path.exists(temp_file_path): - os.remove(temp_file_path) + if os.path.exists(temp_file): + os.remove(temp_file) # copie le fichier upload dans temp_file input_file.seek(0) - with open(temp_file_path, 'wb') as output_file: + with open(temp_file, 'wb') as output_file: shutil.copyfileobj(input_file, output_file) # controler la taille du fichier < 4 Mo - filesize = round(os.path.getsize(temp_file_path) / 1024) + filesize = round(os.path.getsize(temp_file) / 1024) if filesize > 4096: - os.remove(temp_file_path) + os.remove(temp_file) request.session.flash("ERREUR: La taille du fichier dépasse la limite autorisée. Téléchargement impossible.", 'danger') return HTTPFound(location=request.route_url('images')) # using the Python Image Library (PIL) to resize an image - resize_photos(temp_file_path) + resize_photos(temp_file) request.session.flash('%s : Ce fichier est téléchargé avec succès.' % input_name, 'success') return HTTPFound(location=request.route_url('images'))