diff --git a/api/applyEffects.php b/api/applyEffects.php index 09d9ae86f..b20aa22c1 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'], $config['take_collage_frame_always'], $collage_frame_path, $collage_background)) { die(json_encode([ 'error' => 'Could not create collage' ])); diff --git a/config/config.inc.php b/config/config.inc.php index b1e6da292..95722e3c6 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -43,7 +43,10 @@ $config['take_frame'] = false; $config['take_frame_path'] = '../resources/img/frames/frame.png'; $config['take_collage_frame'] = false; +$config['take_collage_frame_always'] = 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..97c2ac5c9 100644 --- a/lib/collage.php +++ b/lib/collage.php @@ -1,41 +1,167 @@ 'take_collage_frame', 'value' => $config['take_collage_frame'] ], + 'take_collage_frame_always' => [ + 'type' => 'checkbox', + 'name' => 'take_collage_frame_always', + 'value' => $config['take_collage_frame_always'] + ], 'take_collage_frame_path' => [ 'type' => 'input', 'placeholder' => $defaultConfig['take_collage_frame_path'], 'name' => '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', + '2x4BI' => '2x4 + background image' + ], + '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 f05ca0f1f..2f40e3e1e 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -57,8 +57,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 + background image\" 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", @@ -144,8 +146,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 + background image\" 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.", @@ -246,6 +250,7 @@ "manual_slideshow_pictureTime": "Add a value which is used as milliseconds an image is displayed at standalone slideshow.", "manual_slideshow_refreshTime": "Refresh standalone slideshow after entered seconds.", "manual_take_collage_frame": "If enabled, defined frame will be applied to your collage after taking it.", + "manual_take_collage_frame_always": "If enabled, defined collage frame will be applied to each picture of your collage instead once after taking it. \"Take collage with frame\" needs to be enabled.", "manual_take_frame": "If enabled, defined frame will be applied to your picture after taking it.", "manual_toggle_fs_button": "If enabled, a button to toggle fullscreenmode will be added to the start screen.", "manual_use_collage": "If enabled, user can take a collage. A collage consists of 4 pictures. Optional you can take a collage with or without interruption.", @@ -353,6 +358,7 @@ "takeCollage": "Take Collage!", "takePhoto": "Take Pic!", "take_collage_frame": "Take collage with frame", + "take_collage_frame_always": "Apply frame to each picture of the collage", "take_frame": "Take picture with frame", "test_update_available": "There is a test update available.", "toggleFullscreen": "Toggle Fullscreen",