Skip to content

Commit 91a039c

Browse files
committed
feat: seperate single and collage image capture command
Change-Id: I6fd40cbb30c6ecb22c8f9b18a89dbe8e848ac81d
1 parent 32b3cb2 commit 91a039c

File tree

6 files changed

+16
-0
lines changed

6 files changed

+16
-0
lines changed

admin/captureconfig.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
$config['commands']['preview'] = '';
3232
$config['commands']['take_picture'] = 'capture %s';
33+
$config['commands']['take_collage'] = 'capture %s';
3334

3435
$config['picture']['cheese_time'] = '0';
3536

admin/wgetcaptureconfig.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
$config['commands']['preview'] = '';
3232
$config['commands']['take_picture'] = 'wget -O %s http://' . Environment::getIp() . ':1984/api/frame.jpeg?src=photobooth';
33+
$config['commands']['take_collage'] = 'wget -O %s http://' . Environment::getIp() . ':1984/api/frame.jpeg?src=photobooth';
3334

3435
$config['picture']['cheese_time'] = '0';
3536

api/capture.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@
8888
} else {
8989
if ($_POST['style'] === 'custom') {
9090
$captureHandler->captureCmd = $config['commands']['take_custom'];
91+
} elseif ($_POST['style'] === 'collage' && !empty($config['commands']['take_collage'])) {
92+
$captureHandler->captureCmd = $config['commands']['take_collage'];
9193
} else {
9294
$captureHandler->captureCmd = $config['commands']['take_picture'];
9395
}

lib/configsetup.inc.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3273,6 +3273,13 @@
32733273
'name' => 'commands[take_picture]',
32743274
'value' => htmlentities($config['commands']['take_picture'] ?? ''),
32753275
],
3276+
'take_collage_cmd' => [
3277+
'view' => 'expert',
3278+
'type' => 'input',
3279+
'placeholder' => $defaultConfig['commands']['take_collage'],
3280+
'name' => 'commands[take_collage]',
3281+
'value' => htmlentities($config['commands']['take_collage'] ?? ''),
3282+
],
32763283
'pre_photo_cmd' => [
32773284
'view' => 'expert',
32783285
'type' => 'input',

resources/lang/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
"commands:print_cmd": "Print command",
113113
"commands:reboot_cmd": "Reboot command",
114114
"commands:shutdown_cmd": "Shutdown command",
115+
"commands:take_collage_cmd": "Take collage image command",
115116
"commands:take_picture_cmd": "Take picture command",
116117
"commands:take_video_cmd": "Command to take a video",
117118
"confirm": "confirm",
@@ -385,6 +386,7 @@
385386
"manual:commands:print_cmd": "Command line which is executed while pressing the \"Print\" button.",
386387
"manual:commands:reboot_cmd": "Command used to initiate reboot via button - example <code>/sbin/shutdown -r now</code>.",
387388
"manual:commands:shutdown_cmd": "Command used to initiate shutdown via button - example <code>/sbin/shutdown -h now</code>.",
389+
"manual:commands:take_collage_cmd": "Command line which is executed while pressing the \"Take Collage\" button. On Linux you can for example use <a href=\"http://www.gphoto.org\" target=\"_blank\">gphoto2</a> to take pictures, on Windows you can use <a href=\"http://digicamcontrol.com\" target=\"_blank\">digiCamControl</a>. If empty, the take picture command is used for collage image capture too.",
388390
"manual:commands:take_picture_cmd": "Command line which is executed while pressing the \"Take Pic\" button. On Linux you can for example use <a href=\"http://www.gphoto.org\" target=\"_blank\">gphoto2</a> to take pictures, on Windows you can use <a href=\"http://digicamcontrol.com\" target=\"_blank\">digiCamControl</a>.",
389391
"manual:commands:take_video_cmd": "Command line which is executed while pressing the \"Take Video\" button.",
390392
"manual:custom:custom_btn_text": "Enter a text which is visible on the custom picture button.",

src/Configuration/Section/CommandsConfiguration.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public static function getNode(): NodeDefinition
1313
$commands = [
1414
'windows' => [
1515
'take_picture' => 'digicamcontrol\CameraControlCmd.exe /capture /filename %s',
16+
'take_collage' => '',
1617
'take_video' => '',
1718
'take_custom' => '',
1819
'print' => 'rundll32 C:\WINDOWS\system32\shimgvw.dll,ImageView_PrintTo %s Printer_Name',
@@ -27,6 +28,7 @@ public static function getNode(): NodeDefinition
2728
],
2829
'linux' => [
2930
'take_picture' => 'gphoto2 --capture-image-and-download --filename=%s',
31+
'take_collage' => '',
3032
'take_video' => 'python3 cameracontrol.py -v %s --vlen 3 --vframes 4',
3133
'take_custom' => 'python3 cameracontrol.py --chromaImage=/var/www/html/resources/img/bg.jpg --chromaColor 00ff00 --chromaSensitivity 0.4 --chromaBlend 0.1 --capture-image-and-download %s',
3234
'print' => 'lp -o landscape -o fit-to-page %s',
@@ -55,6 +57,7 @@ public static function getNode(): NodeDefinition
5557
->ignoreExtraKeys()
5658
->children()
5759
->scalarNode('take_picture')->defaultValue($defaults['take_picture'])->end()
60+
->scalarNode('take_collage')->defaultValue($defaults['take_collage'])->end()
5861
->scalarNode('take_custom')->defaultValue($defaults['take_custom'])->end()
5962
->scalarNode('take_video')->defaultValue($defaults['take_video'])->end()
6063
->scalarNode('print')->defaultValue($defaults['print'])->end()

0 commit comments

Comments
 (0)