diff --git a/api/applyEffects.php b/api/applyEffects.php index 09d9ae86f..7f6d0ba6e 100644 --- a/api/applyEffects.php +++ b/api/applyEffects.php @@ -22,6 +22,7 @@ $filename_thumb = $config['foldersAbs']['thumbs'] . DIRECTORY_SEPARATOR . $file; $frame_path = __DIR__ . DIRECTORY_SEPARATOR .$config['take_frame_path']; $collage_frame_path = __DIR__ . DIRECTORY_SEPARATOR .$config['take_collage_frame_path']; +$collage_background = __DIR__ . DIRECTORY_SEPARATOR .$config['collage_background']; $picture_permissions = $config['picture_permissions']; if (isset($_POST['isCollage']) && $_POST['isCollage'] === 'true') { @@ -32,7 +33,7 @@ $collageSrcImagePaths[] = $collageBasename . '-' . $i . '.jpg'; } - if (!createCollage($collageSrcImagePaths, $filename_tmp, $config['take_collage_frame'], $collage_frame_path)) { + if (!createCollage($collageSrcImagePaths, $filename_tmp, $config['take_collage_frame'], $collage_frame_path, $config['collage_layout'], $collage_background)) { die(json_encode([ 'error' => 'Could not create collage' ])); diff --git a/config/config.inc.php b/config/config.inc.php index dac810f72..db48bd2c6 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -51,6 +51,8 @@ $config['take_frame_path'] = '../resources/img/frames/frame.png'; $config['take_collage_frame'] = false; $config['take_collage_frame_path'] = '../resources/img/frames/frame.png'; +$config['collage_layout'] = '2x2'; // possible values are '2x2' or '2x4' +$config['collage_background'] = '../resources/img/frames/DefaultCollageBackground.png'; $config['chroma_keying'] = false; $config['use_collage'] = true; $config['continuous_collage'] = true; diff --git a/lib/collage.php b/lib/collage.php index 50cd6de3b..82ff40087 100644 --- a/lib/collage.php +++ b/lib/collage.php @@ -1,41 +1,73 @@ 'take_collage_frame_path', 'value' => htmlentities($config['take_collage_frame_path']) ], + 'collage_layout' => [ + 'type' => 'select', + 'name' => 'collage_layout', + 'placeholder' => $defaultConfig['collage_layout'], + 'options' => [ + '2x2' => '2x2', + '2x4' => '2x4' + ], + 'value' => $config['collage_layout'] + ], + 'collage_background' => [ + 'type' => 'input', + 'name' => 'collage_background', + 'placeholder' => $defaultConfig['collage_background'], + 'value' => $config['collage_background'] + ], 'collage_cntdwn_time' => [ 'type' => 'range', 'name' => 'collage_cntdwn_time', diff --git a/resources/img/frames/DefaultCollageBackground.png b/resources/img/frames/DefaultCollageBackground.png new file mode 100644 index 000000000..c04271293 Binary files /dev/null and b/resources/img/frames/DefaultCollageBackground.png differ diff --git a/resources/lang/en.json b/resources/lang/en.json index 8f5d8a7df..20666ecd5 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -56,8 +56,10 @@ "general_camera_mode": "Camera facing mode", "general_cheese_time": "Cheeeeeeeese!-Timer:", "general_cntdwn_time": "Countdown timer:", + "general_collage_background": "Path to the background for 2x4 collage", "general_collage_cntdwn_time": "Collage-countdown timer:", "general_collage_key": "Key code which triggers a collage", + "general_collage_layout": "Choose collage layout:", "general_db_file": "Database file name", "general_default_imagefilter": "Default image filter", "general_disabled_filters": "Disabled image filters", @@ -142,8 +144,10 @@ "manual_general_camera_mode": "Choose between front- or back facing camera mode of your device cam.", "manual_general_cheese_time": "Set a time to display \"Cheeeeeeeese!\" after the countdown.", "manual_general_cntdwn_time": "Set your countdown time.", + "manual_general_collage_background": "Enter the path of the background which is applied to your collage on 2x4 collage layout.", "manual_general_collage_cntdwn_time": "Set your countdown time between pictures while taking a collage.", "manual_general_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.", + "manual_general_collage_layout": "Choose between 2x2 and 2x4 pictures collage layout.", "manual_general_db_file": "Name of the database file.", "manual_general_default_imagefilter": "Choose an image filter which is applied by default after taking a picture.", "manual_general_disabled_filters": "Choose filters which get removed from the available image filters.",