Skip to content

Commit 17cb404

Browse files
authored
bugfix misc (#1394)
* fix doc lists * rembg dont spam info logs * scale down for rem bg * more time for rembg curl * fix load collage font path * Revert "fix load collage font path" This reverts commit 3bebfee. * fix load collage font path
1 parent 1c4e1aa commit 17cb404

File tree

11 files changed

+44
-18
lines changed

11 files changed

+44
-18
lines changed

api/applyEffects.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,20 @@
134134
}
135135

136136
if (!$vars['isCollage'] || $vars['editSingleCollage']) {
137+
$filterProcessSize = intval($config['filters']['process_size'] ?? 0);
138+
$downscaledForFilter = false;
139+
137140
// apply filter (optionally downscale first for performance)
138141
if ($vars['imageFilter'] !== null && $vars['imageFilter'] !== ImageFilterEnum::PLAIN) {
139142
$originalWidth = imagesx($imageResource);
140143
$originalHeight = imagesy($imageResource);
141144
$filterResource = $imageResource;
142145

143-
$filterProcessSize = intval($config['filters']['process_size'] ?? 0);
144146
if ($filterProcessSize > 0 && ($originalWidth > $filterProcessSize || $originalHeight > $filterProcessSize)) {
145147
$downscaled = $imageHandler->resizeImage($imageResource, $filterProcessSize);
146148
if ($downscaled instanceof \GdImage) {
147149
$filterResource = $downscaled;
150+
$downscaledForFilter = true;
148151
}
149152
}
150153

@@ -194,6 +197,18 @@
194197
}
195198
}
196199

200+
// Apply rembg (downscale first if filters_process_size is set and not already downscaled for filters)
201+
if ($filterProcessSize > 0 && !$downscaledForFilter) {
202+
$width = imagesx($imageResource);
203+
$height = imagesy($imageResource);
204+
if ($width > $filterProcessSize || $height > $filterProcessSize) {
205+
$downscaled = $imageHandler->resizeImage($imageResource, $filterProcessSize);
206+
if ($downscaled instanceof \GdImage) {
207+
$imageResource = $downscaled;
208+
}
209+
}
210+
}
211+
197212
// Apply rembg
198213
[$imageHandler, $imageResource] = Rembg::process($imageHandler, $vars, $config['rembg'], $imageResource);
199214
if ($config['picture']['polaroid_effect']) {

assets/js/admin/generator.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ function loadCurrentConfig() {
115115
$('input[name=\'text_enabled\'][data-trigger=\'general\']').prop('checked', text_enabled);
116116
$('input[name=\'text_font_family\']').val(font_family);
117117
$('input[name=\'text_font_family\']')[0].setAttribute('data-fontclass', 'font-selected');
118+
const font_family_public = toPublicUrl(font_family);
118119
$('#fontselectedStyle').html(
119-
`@font-face{font-family:"fontselected";src:url(${font_family}) format("truetype");} .font-selected{font-family:"fontselected",Verdena,Tahoma;}`
120+
`@font-face{font-family:"fontselected";src:url(${font_family_public}) format("truetype");} .font-selected{font-family:"fontselected",Verdena,Tahoma;}`
120121
);
121122
$('input[name=\'text_font_color\']').attr('value', font_color);
122123
$('input[name=\'text_font_size\']').attr('value', font_size);
@@ -172,7 +173,7 @@ function changeGeneralSetting() {
172173
const c_text_enabled = $('input[name=\'text_enabled\'][data-trigger=\'general\']').is(':checked');
173174
let c_text_font = $('input[name=\'text_font_family\']')[0].getAttribute('data-fontclass');
174175
let c_text_font_unique_id = $('input[name=\'text_font_family\']').data('unique-id');
175-
let c_text_font_value = $('input[name=\'text_font_family\']').val();
176+
let c_text_font_value = toPublicUrl($('input[name=\'text_font_family\']').val());
176177
const c_font_color = $('input[name=\'text_font_color\']').val();
177178
const c_font_size = $('input[name=\'text_font_size\']').val();
178179
const c_text_1 = $('input[name=\'text_line_1\']').val();

docs/code_of_conduct.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,22 @@ diverse, inclusive, and healthy community.
1818
Examples of behavior that contributes to a positive environment for our
1919
community include:
2020

21+
2122
* Demonstrating empathy and kindness toward other people
2223
* Being respectful of differing opinions, viewpoints, and experiences
2324
* Giving and gracefully accepting constructive feedback
24-
* Accepting responsibility and apologizing to those affected by our mistakes,
25-
and learning from the experience
25+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
2626
* Focusing on what is best not just for us as individuals, but for the overall
2727
community
2828

2929
Examples of unacceptable behavior include:
3030

31-
* The use of sexualized language or imagery, and sexual attention or advances of
32-
any kind
31+
32+
* The use of sexualized language or imagery, and sexual attention or advances of any kind
3333
* Trolling, insulting or derogatory comments, and personal or political attacks
3434
* Public or private harassment
35-
* Publishing others' private information, such as a physical or email address,
36-
without their explicit permission
37-
* Other conduct which could reasonably be considered inappropriate in a
38-
professional setting
35+
* Publishing others' private information, such as a physical or email address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a professional setting
3937

4038
## Enforcement Responsibilities
4139

docs/contributing-docs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Help improve the Photobooth docs by following these steps.
1414
python3 -m venv .venv
1515
source .venv/bin/activate
1616
```
17+
1718
- Install MkDocs and the theme:
1819
```
1920
pip install mkdocs mkdocs-material
@@ -26,6 +27,7 @@ Help improve the Photobooth docs by following these steps.
2627
mkdocs build --config-file mkdocs_remote.yml
2728
mkdocs serve -f mkdocs_remote.yml
2829
```
30+
2931
- Open the URL shown in the terminal (typically `http://127.0.0.1:8000`) to review your changes live.
3032

3133
## 4) Edit guidelines

docs/faq/go2rtc-troubleshooting.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Access go2rtc via [http://localhost:1984](http://localhost:1984) and, maybe, adj
2727
**2 executes `gphoto2` / `rpicam-still` / `fswebcam` with the corresponding parameters.**
2828

2929
If only `%s` is passed, it uses by default the following arguments:
30+
3031
- on `gphoto2`: `--set-config output=Off --capture-image-and-download --filename=%s`
3132
- on `rpicam-still`: `-n -q 100 -o %s`
3233
- on `fswebcam`: `--no-banner -d /dev/video0 -r 1280x720 %s`

docs/faq/hide-cursor.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
> Note: Tools like `unclutter` do not work on Wayland.
44
55
## Pi OS Trixie (Wayland)
6+
67
- Hide the cursor by renaming the pointer icon:
78
```
89
sudo mv /usr/share/icons/PiXtrix/cursors/left_ptr /usr/share/icons/PiXtrix/cursors/left_ptr.bak
@@ -17,6 +18,7 @@
1718
```
1819
sudo mv /usr/share/icons/PiXflat/cursors/left_ptr /usr/share/icons/PiXflat/cursors/left_ptr.bak
1920
```
21+
2022
- Disable screen blanking:
2123
```
2224
sudo raspi-config nonint do_blanking 1
@@ -25,6 +27,7 @@
2527
```
2628
sudo raspi-config nonint do_blanking 0
2729
```
30+
2831
- Turn off the screensaver by editing `/etc/xdg/lxsession/LXDE-pi/autostart` and removing `@xscreensaver -no-splash`.
2932
- Prevent DPMS screen blanking by creating `/etc/X11/xorg.conf.d/99-dpms.conf`:
3033
```
@@ -39,6 +42,7 @@
3942
```
4043

4144
## Pi OS Bullseye and earlier (X11)
45+
4246
- Disable screensaver and screen blanking with `sudo raspi-config`:
4347
- 1 System Options → S6 Boot / Auto Login → choose desktop auto-login.
4448
- 1 System Options → S6 Screen Blanking → disable.

docs/faq/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,7 @@ Yes you can. There's different ways depending on your needs and personal setup:
188188
2. You need to change the background URL path via config or admin panel. Replace `url(../img/bg.jpg)` with your IP-Adress and port (if needed) as URL.
189189
Example:
190190

191-
```
192-
- /img/bg.jpg
193-
+ http://192.168.0.2:8081
194-
```
191+
Use `http://192.168.0.2:8081` (or your own stream URL) in place of `/img/bg.jpg`.
195192

196193
To use an DSLR or an Raspberry Pi Camera module see _Setting up a preview stream from your DSLR or PiCamera_ above.
197194

@@ -201,6 +198,7 @@ Yes you can. There's different ways depending on your needs and personal setup:
201198

202199
If connection fails some help can be found inside the official [PHPMailer Wiki](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting), especially gmail needs some special config.
203200

201+
204202
- Should be obvious but the photobooth must be connected to WIFI/internet to send photos live.
205203

206204
Otherwise, tell them to check the box to send them the photo later and it will add everyone's email to a list for you.
@@ -260,6 +258,7 @@ Take a look for "Loaded Configuration File" to get the path of your php.ini, you
260258
This feature will automatically and in regular intervals copy (sync) new pictures to a plugged-in USB stick
261259

262260
Use the [Photobooth Setup Wizard](https://photoboothproject.github.io/install/setup_wizard) to get the operating system setup in place.
261+
263262
- 6. Permissions -> USB Sync policy
264263

265264
The target USB device is selected through the admin panel.
@@ -534,6 +533,7 @@ Magic Greenscreen is a feature that uses AI to automatically remove backgrounds
534533
Choose __8 Rembg Setup__
535534

536535
This script will:
536+
537537
- Check for Python 3 and required packages
538538
- Create a virtual environment in `/var/www/rembg/rembg_venv`
539539
- Install rembg and its dependencies (PIL, onnxruntime)

docs/faq/preview.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@ Keeps the DSLR connection alive for preview + capture on Linux.
5151

5252
## Troubleshooting
5353

54+
5455
- Check v4l2loopback after updates:
5556
```
5657
v4l2-ctl --list-devices
5758
```
5859
Expected: `GPhoto2 Webcam (platform:v4l2loopback-000): /dev/video0`
60+
5961
- If missing, rebuild v4l2loopback:
6062
```
6163
curl -LO https://github.com/umlaeute/v4l2loopback/archive/refs/tags/v0.12.7.tar.gz
@@ -64,6 +66,7 @@ Keeps the DSLR connection alive for preview + capture on Linux.
6466
sudo depmod -a
6567
sudo modprobe v4l2loopback exclusive_caps=1 card_label="GPhoto2 Webcam"
6668
```
69+
6770
- Chromium may pick the wrong webcam (e.g. `bcm2835-isp`); disable other webcams if needed.
6871
- Long preview startup? Increase countdown (e.g. 8s) or run preview continuously (higher battery/CPU).
6972
- For command help: `python3 /var/www/html/api/cameracontrol.py --help` (adjust path if installed in a subfolder).

docs/install/prerequisites.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Prerequisites
22

3-
| Software | Required version | Note
3+
| Software | Required version | Note |
44
|-------------------|------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
55
| Node.js | >=v20.15.0 | Currently only v20 is tested. Our installer will check your Node.js version and suggest an update/downgrade if needed. Versions below v20 aren't supported anymore. |
66
| npm | >=v10.7.0 | |

docs/install/setup_wizard.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
To make the installation and optional feature setup as simple as possible, we have created the "Photobooth Setup Wizard" for you. It can setup your Raspberry Pi, Computer or Laptop as a full blown Photobooth.
44

55
This means:
6+
67
- Photobooth and all needed packages and dependencies get installed and the automatic camera mount is disabled on installaion.
78
- Optional permissions can be set/unset
89
- Shortcuts and autostart in kiosk mode can be setup/removed
@@ -17,5 +18,6 @@ sudo bash install-photobooth.sh
1718
```
1819

1920
On Photobooth installation by default Apache is used for an easy and no-hassle setup.
21+
2022
- Adjust your installation setup if needed: 1 Installation configuration
2123
- To get to know all options you can simply run `sudo bash install-photobooth.sh --help`.

0 commit comments

Comments
 (0)