From 8d86ce29dfb01b271c2e035194a61e8bbdad8f70 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Fri, 3 Jun 2022 14:44:01 +0200 Subject: [PATCH] Limit image size. Link to tinypng --- app/settings.py | 4 ++-- templates/questions/detail_edit.html | 3 ++- templates/quizs/detail_edit.html | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/settings.py b/app/settings.py index 7fd3dfb15..2810007ca 100644 --- a/app/settings.py +++ b/app/settings.py @@ -276,8 +276,8 @@ "allowed_mime_types": ["image/png", "image/svg+xml", "image/gif", "image/jpg", "image/jpeg"], # ["image/*"] ? "upload_expiration": 60 * 60, # in seconds "key_path": "default", # appended before the file key. No backslash! - "max_files": 1, # 3, - "max_file_size": 5, # in mb + "max_files": 1, + "max_file_size": 2, # in mb "timeout": 20000, # in ms }, "question_answer_image": { diff --git a/templates/questions/detail_edit.html b/templates/questions/detail_edit.html index f1cbdd4d5..d356ccf35 100644 --- a/templates/questions/detail_edit.html +++ b/templates/questions/detail_edit.html @@ -29,10 +29,11 @@ {% include "includes/_s3_upload_form.html" with dropzone_form_id="image_form" %} + Image trop grosse ? pour réduire la taille d'une image : tinypng.com
- + {% if form.answer_image_url.value %}
diff --git a/templates/quizs/detail_edit.html b/templates/quizs/detail_edit.html index d9bf603c5..3d8939617 100644 --- a/templates/quizs/detail_edit.html +++ b/templates/quizs/detail_edit.html @@ -31,10 +31,11 @@ {% include "includes/_s3_upload_form.html" with dropzone_form_id="image_form" %}
+ Image trop grosse ? pour réduire la taille d'une image : tinypng.com
- + {% if form.image_background_url.value %}