From 033b784576c967983f08970b479d408da86494e8 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 6 Apr 2020 13:21:08 +0200 Subject: [PATCH] Add max file size in whiteboard --- www/whiteboard/inner.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/www/whiteboard/inner.js b/www/whiteboard/inner.js index 5dd436909..0af0b8ee1 100644 --- a/www/whiteboard/inner.js +++ b/www/whiteboard/inner.js @@ -363,6 +363,11 @@ define([ }); }; var addImageToCanvas = function (img) { + // 1 MB maximum + if (img.src && img.src.length > 1 * 1024 * 1024) { + UI.warn(Messages.upload_tooLargeBrief); + return; + } var w = img.width; var h = img.height; if (w 1 * 1024 * 1024) { + UI.warn(Messages.upload_tooLargeBrief); + return; + } reader.onload = function () { var img = new Image(); img.onload = function () {