From 8b1f9430357c80bc6d2f3d8fdf31bf31c70e9c9c Mon Sep 17 00:00:00 2001 From: Christian Tarne Date: Tue, 3 Aug 2021 13:28:27 +0200 Subject: [PATCH] implement countdown offset to compensate shutter-delay and cheese time --- 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 fe7a368d1..1ab2a2762 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -46,6 +46,7 @@ // P I C T U R E S // control countdown timer in seconds $config['picture']['cntdwn_time'] = '5'; +$config['picture']['cntdwn_offset'] = '0'; $config['picture']['no_cheese'] = false; // control time for cheeeeese! in milliseconds $config['picture']['cheese_time'] = '1000'; diff --git a/lib/configsetup.inc.php b/lib/configsetup.inc.php index fcb996d48..ce82066cf 100644 --- a/lib/configsetup.inc.php +++ b/lib/configsetup.inc.php @@ -326,6 +326,17 @@ 'range_step' => 1, 'unit' => 'seconds', ], + 'picture_cntdwn_offset' => [ + 'view' => 'advanced', + 'type' => 'range', + 'name' => 'picture[cntdwn_offset]', + 'placeholder' => $defaultConfig['picture']['cntdwn_offset'], + 'value' => $config['picture']['cntdwn_offset'], + 'range_min' => 0, + 'range_max' => 10, + 'range_step' => 1, + 'unit' => 'seconds', + ], 'picture_no_cheese' => [ 'view' => 'basic', 'type' => 'checkbox', diff --git a/resources/lang/en.json b/resources/lang/en.json index b55b7aaae..45018e61d 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -310,6 +310,7 @@ "manual:pictures:filters_enabled": "If enabled, user can choose a imagefiler after taking a picture.", "manual:pictures:picture_allow_delete": "If enabled pictures can be deleted on result page directly after they have been taken.", "manual:pictures:picture_cheese_time": "Set a time to display \"Cheeeeeeeese!\" after the countdown.", + "manual:pictures:picture_cntdwn_offset": "Set an offset to the countdown to compensate the delay because of cheese time, focus and shutter speed.", "manual:pictures:picture_cntdwn_time": "Set your countdown time.", "manual:pictures:picture_flip": "Choose if your picture is flipped after taken.", "manual:pictures:picture_frame": "Enter the path of the frame which is applied to your picture after taking it.", @@ -414,6 +415,7 @@ "pictures:filters_enabled": "Allow image filter", "pictures:picture_allow_delete": "Allow deletion of the image", "pictures:picture_cheese_time": "Cheeeeeeeese!-Timer:", + "pictures:picture_cntdwn_offset": "Countdown offset:", "pictures:picture_cntdwn_time": "Countdown timer:", "pictures:picture_flip": "Flip image:", "pictures:picture_frame": "Frame", diff --git a/src/js/core.js b/src/js/core.js index 08037cedb..0af0104d3 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -899,7 +899,7 @@ const photoBooth = (function () { const stop = start > 2 ? start - 2 : start; function timerFunction() { - element.text(current); + element.text(Number(current) + Number(config.picture.cntdwn_offset)); current--; element.removeClass('tick');