Skip to content

Commit

Permalink
Merge pull request #206
Browse files Browse the repository at this point in the history
- README: update formatting and cleanup
- Fix undefined placeholder warnings
- take picture: red error message
- Allow admins to choose what gets deleted at reset (inspired by #178)
  - always:
    - delete db.txt
  - optional (but enabled by default):
    - delete images
    - delete "mail-addresses.txt
    - delete personal config (my.config.inc.php)
- Add possibility to choose dark countdown background (inspired by #198 )
- Allow defining Photobooth web server IP to fix image download via QR-Code if Photobooth is accessed via localhost/127.0.0.1
  • Loading branch information
andi34 authored Dec 18, 2019
2 parents dbd0f52 + e93b416 commit e124531
Show file tree
Hide file tree
Showing 14 changed files with 201 additions and 74 deletions.
62 changes: 40 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,81 @@
# photobooth by Andre Rinas
A Photobooth webinterface for Raspberry Pi and Windows.
# Photobooth by Andre Rinas

A Photobooth web interface for Raspberry Pi and Windows.

## :heart_eyes: Features

- Works on Windows and Linux.
- Under Windows [digiCamControl](http://digicamcontrol.com/) by Duka Istvan can be used to control the camera and to take pictures.
- Under Linux [gPhoto2](http://gphoto.org/) is used to control the camera and to take pictures.
- Under Windows [digiCamControl](http://digicamcontrol.com/) by Duka Istvan
can be used to control the camera and to take pictures.
- Under Linux [gPhoto2](http://gphoto.org/) is used to control the camera and
to take pictures.
- Images are processed with GD.
- Photobooth caches all generated QR-Codes, Thumbnails and Prints.
- Standalone Gallery (`localhost/gallery.php`).
- Settings can be changed via Admin Panel (under `localhost/admin`):
- Multi-language support:
- german
- english
- spanish
- french
- greek
- German
- English
- Spanish
- French
- Greek
- Gallery:
- Order pictures in gallery ascending oder descending by picture age.
- Hide the gallery.
- Choose between md5format and dateformat image names.
- Order pictures in gallery ascending oder descending by picture age.
- Hide the gallery.
- Choose between md5- or date-formatted image names.
- Choose an image filter before taking a picture.
- QR-Code to allow downloading pictures from your Photobooth.
- Pictures can be directly downloaded from the gallery.
- Print feature.
- Optional: Print a frame on your picture (replace resources/img/frames/frame.png with a proper frame).
- Optional: Print a frame on your picture
(replace `resources/img/frames/frame.png` with a frame of your choice).
- Optional: Print text on your picture.
- Optional: Print QR-Code on the right side of your picture.
- Pictures can be send via E-Mail.
- Pictures can be sent via e-mail.
- LivePreview (uses device cam).
- Event (e.g. wedding, birthday) specifig config to show a symbol (e.g. heart) betweeen some text on the startpage.
- Event specific (e.g. wedding, birthday) config to show a symbol (e.g. heart)
between some text on the start page.
- Green screen keying (chroma keying).
- Photo collage function: take 4 pictures in a row with or without interruption and let it generate a collage out of it.
- Save pictures with a polaroid effect.
- Photo collage function: take 4 pictures in a row with or without
interruption and let it generate a collage out of it.
- Save pictures with a Polaroid effect.
- Adjust take picture and print commands.
- Optional Blue-gray theme.
- And many more options to adjust Photobooth for your personal needs.

## :camera: Screenshots

![](https://raw.githubusercontent.com/wiki/andreknieriem/photobooth/images/start.png)

## :gear: Prerequisites

- gphoto2 installed, if used on a Raspberry for DSLR control
- digiCamControl, if used unter Windows for DSLR control
- NGINX, Lighttpd or Apache

## :wrench: Installation & Troubleshooting
Please follow the installation instructions in our [Photobooth-Wiki](https://github.com/andreknieriem/photobooth/wiki) to setup Photobooth.

If you're having trouble or questions please take a look at our [FAQ](https://github.com/andreknieriem/photobooth/wiki#faq---frequently-asked-questions) before opening a new issue.
Please follow the installation instructions in our
[Photobooth-Wiki](https://github.com/andreknieriem/photobooth/wiki) to setup
Photobooth.

If you're having trouble or questions please take a look at our
[FAQ](https://github.com/andreknieriem/photobooth/wiki#faq---frequently-asked-questions)
before opening a new issue.

### :mag: Changelog

Please take a look at the changelog in our [Photobooth Wiki](https://github.com/andreknieriem/photobooth/wiki/changelog).

### :mortar_board: Tutorial

[Raspberry Pi Weddingphotobooth (german)](https://www.andrerinas.de/tutorials/raspberry-pi-einen-dslr-weddingphotobooth-erstellen.html)

### :clap: Contributors and thanks to
- [dimsemenov](https://github.com/dimsemenov/photoswipe) for photoswipe
- [t0k4rt](https://github.com/t0k4rt/phpqrcode) for phpqrcode
- [nihilor](https://github.com/nihilor/photobooth) for Printing feature, code rework and bugfixes

- [dimsemenov](https://github.com/dimsemenov/photoswipe)
- [t0k4rt](https://github.com/t0k4rt/phpqrcode)
- [nihilor](https://github.com/nihilor/photobooth)
- [vrs01](https://github.com/vrs01)
- [F4bsi](https://github.com/F4bsi)
- [got-x](https://github.com/got-x)
Expand Down
31 changes: 21 additions & 10 deletions api/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,32 @@
}

if ($data['type'] == 'reset') {
// empty folders
foreach ($config['foldersAbs'] as $folder) {
if (is_dir($folder)) {
$files = glob($folder.'/*.jpg');
foreach ($files as $file) { // iterate files
if (is_file($file)) {
unlink($file); // delete file
if($config['reset_remove_images']) {
// empty folders
foreach ($config['foldersAbs'] as $folder) {
if (is_dir($folder)) {
$files = glob($folder.'/*.jpg');
foreach ($files as $file) { // iterate files
if (is_file($file)) {
unlink($file); // delete file
}
}
}
}
}

// delete mail-addresses.txt
if(is_file('../mail-addresses.txt')){
unlink('../mail-addresses.txt');
if($config['reset_remove_mailtxt']) {
// delete mail-addresses.txt
if(is_file('../mail-addresses.txt')){
unlink('../mail-addresses.txt');
}
}

if($config['reset_remove_config']) {
// delete personal config
if(is_file('../config/my.config.inc.php')){
unlink('../config/my.config.inc.php');
}
}

// delete db.txt
Expand Down
9 changes: 8 additions & 1 deletion api/print.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
$filename_thumb = $config['foldersAbs']['thumbs'] . DIRECTORY_SEPARATOR . $filename;
$status = false;

// QR
if (!isset($config['webserver_ip'])) {
$SERVER_IP = $_SERVER['HTTP_HOST'];
} else {
$SERVER_IP = $config['webserver_ip'];
}

// text on print variables
$fontsize = $config['fontsize'];
$fontlocx = $config['locationx'];
Expand All @@ -39,7 +46,7 @@
// create qr code
if (!file_exists($filename_codes)) {
include('../vendor/phpqrcode/qrlib.php');
$url = 'http://'.$_SERVER['HTTP_HOST'].'/api/download.php?image=';
$url = 'http://'.$SERVER_IP.'/api/download.php?image=';
QRcode::png($url.$filename, $filename_codes, QR_ECLEVEL_H, 10);
}

Expand Down
10 changes: 9 additions & 1 deletion api/qrcode.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<?php
require_once('../lib/config.php');

if (!isset($config['webserver_ip'])) {
$SERVER_IP = $_SERVER['HTTP_HOST'];
} else {
$SERVER_IP = $config['webserver_ip'];
}

$filename = $_GET['filename'];
include('../vendor/phpqrcode/qrlib.php');
$url = 'http://'.$_SERVER['HTTP_HOST'].'/api/download.php?image=';
$url = 'http://'.$SERVER_IP.'/api/download.php?image=';
QRcode::png($url.$filename, false, QR_ECLEVEL_H, 10);
6 changes: 6 additions & 0 deletions config/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
$config['background_admin'] = null;
$config['background_chroma'] = null;
$config['force_buzzer'] = false;
$config['dark_loader'] = false;
$config['webserver_ip'] = null;

// specify key id to use that key to take a picture or collage (e.g. 13 is the enter key)
// use for example https://keycode.info to get the key code
Expand Down Expand Up @@ -107,3 +109,7 @@
$config['jpeg_quality_chroma'] = 70;
$config['jpeg_quality_image'] = 80;

// RESET
$config['reset_remove_images'] = true;
$config['reset_remove_mailtxt'] = true;
$config['reset_remove_config'] = true;
Loading

0 comments on commit e124531

Please sign in to comment.