From 51cedcdea5bffcb1b2def40a031e989028159c31 Mon Sep 17 00:00:00 2001 From: Andreas Blaesius Date: Sat, 3 Jul 2021 23:18:27 +0200 Subject: [PATCH 1/3] collage: always show image between pictures Change-Id: I32e756f7da1d9779551e8028f7de338091f792b6 --- src/js/core.js | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/js/core.js b/src/js/core.js index cda61cdb0..89e282adc 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -476,9 +476,26 @@ const photoBooth = (function () { $('.loading').empty(); $('#video--sensor').hide(); + let imageUrl = config.foldersRoot.tmp + '/' + result.collage_file; + const preloadImage = new Image(); + const picdate = Date.now; + preloadImage.onload = () => { + $('.loaderImage').css({ + 'background-image': `url(${imageUrl}?filter=${imgFilter})` + }); + $('.loaderImage').attr('data-img', picdate); + }; + + preloadImage.src = imageUrl; + + $('.loaderImage').show(); + if (config.collage.continuous) { if (result.current + 1 < result.limit) { setTimeout(() => { + $('.loaderImage').css('background-image', 'none'); + imageUrl = ''; + $('.loaderImage').css('display', 'none'); api.thrill('collage'); }, 1000); } else { @@ -489,20 +506,6 @@ const photoBooth = (function () { } } else { // collage with interruption - let imageUrl = config.foldersRoot.tmp + '/' + result.collage_file; - const preloadImage = new Image(); - const picdate = Date.now; - preloadImage.onload = () => { - $('.loaderImage').css({ - 'background-image': `url(${imageUrl}?filter=${imgFilter})` - }); - $('.loaderImage').attr('data-img', picdate); - }; - - preloadImage.src = imageUrl; - - $('.loaderImage').show(); - remoteBuzzerClient.collageWaitForNext(); if (result.current + 1 < result.limit) { From 3c27567e0b594dd3efcf742b779f0531b5ff0b85 Mon Sep 17 00:00:00 2001 From: Andreas Blaesius Date: Sun, 4 Jul 2021 12:10:23 +0200 Subject: [PATCH 2/3] continuous collage: wait 5 seconds for next picture Change-Id: Ieb03f34eee64e5a1b35a97dadfb3059ef279cf03 --- src/js/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/core.js b/src/js/core.js index 89e282adc..4ef0691fc 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -497,7 +497,7 @@ const photoBooth = (function () { imageUrl = ''; $('.loaderImage').css('display', 'none'); api.thrill('collage'); - }, 1000); + }, 5000); } else { currentCollageFile = ''; nextCollageNumber = 0; From 842df45022ac8d192f4be85ea5b6e3179f9e3bb1 Mon Sep 17 00:00:00 2001 From: Andreas Blaesius Date: Wed, 7 Jul 2021 10:46:33 +0200 Subject: [PATCH 3/3] continuous collage: make time adjustable single image is visible Change-Id: I094a4cae85b08d6c86c06bdb46df9c55369bee3e --- config/config.inc.php | 1 + lib/configsetup.inc.php | 11 +++++++++++ resources/lang/en.json | 2 ++ src/js/core.js | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/config/config.inc.php b/config/config.inc.php index 2de027a03..41d51d1f1 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -89,6 +89,7 @@ // control countdown timer between collage pictures in seconds $config['collage']['cntdwn_time'] = '3'; $config['collage']['continuous'] = true; +$config['collage']['continuous_time'] = '5'; // possible layout values: '2x2', '2x2-2', '2x4', '2x4-2', '1+3', '1+2' $config['collage']['layout'] = '2x2-2'; // specify key id (e.g. 13 is the enter key) to use that key to take a collage (collage key) diff --git a/lib/configsetup.inc.php b/lib/configsetup.inc.php index 01252a6aa..7a0b1d3b9 100644 --- a/lib/configsetup.inc.php +++ b/lib/configsetup.inc.php @@ -564,6 +564,17 @@ 'name' => 'collage[continuous]', 'value' => $config['collage']['continuous'], ], + 'collage_continuous_time' => [ + 'view' => 'basic', + 'type' => 'range', + 'name' => 'collage[continuous_time]', + 'placeholder' => $defaultConfig['collage']['continuous_time'], + 'value' => $config['collage']['continuous_time'], + 'range_min' => 1, + 'range_max' => 20, + 'range_step' => 1, + 'unit' => 'seconds', + ], 'collage_layout' => [ 'view' => 'advanced', 'type' => 'select', diff --git a/resources/lang/en.json b/resources/lang/en.json index f5e9d68ee..682bdddd8 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -27,6 +27,7 @@ "collage": "Collage", "collage:collage_cntdwn_time": "Collage-countdown timer:", "collage:collage_continuous": "Take collage without interruption", + "collage:collage_continuous_time": "Show single images on continuous collage for:", "collage:collage_enabled": "Allow photo collage", "collage:collage_frame": "Frame", "collage:collage_key": "Key code which triggers a collage", @@ -183,6 +184,7 @@ "manual:authentication:protect_manual": "If enabled, manual and FAQ can only be accessed if a username and password is entered.", "manual:collage:collage_cntdwn_time": "Set your countdown time between pictures while taking a collage.", "manual:collage:collage_continuous": "Take collage without interrupption.", + "manual:collage:collage_continuous_time": "Controll the time a picture is visible on continuous collage before the next picture is taken.", "manual:collage:collage_enabled": "If enabled, user can take a collage. A collage consists of 4 pictures. Optional you can take a collage with or without interruption.", "manual:collage:collage_frame": "Enter the path of the frame which is applied to your collage after taking it.", "manual:collage:collage_key": "Specify the key id to use that key to take a collage (e.g. 13 is the enter key). For example use https://keycode.info to find out the key id.", diff --git a/src/js/core.js b/src/js/core.js index 4ef0691fc..cc3397b98 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -497,7 +497,7 @@ const photoBooth = (function () { imageUrl = ''; $('.loaderImage').css('display', 'none'); api.thrill('collage'); - }, 5000); + }, config.collage.continuous_time * 1000); } else { currentCollageFile = ''; nextCollageNumber = 0;