Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Collage: Always show image after taken #271

Merged
merged 3 commits into from
Jul 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions lib/configsetup.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions resources/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 <a href=\"https://keycode.info\" target=\"_blank\">https://keycode.info</a> to find out the key id.",
Expand Down
33 changes: 18 additions & 15 deletions src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,28 @@ 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);
}, config.collage.continuous_time * 1000);
} else {
currentCollageFile = '';
nextCollageNumber = 0;
Expand All @@ -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) {
Expand Down