06.02.2018

Photobooth Software Version 3


Server Scripts
  1. Captive Portal / Gastzugang auf Fritzbox 7490 mit Weiterleitung auf Webserver des MacBooks einrichten
  2. Webserver starten
    php -S 0.0.0.0:8000
    
  3. Gphoto installieren (stabiler als Sofortbild und captureOne, wo Klicks nur über osascript oder cliclick simulierbar sind. GPhoto unterstützt 159 Kameras) “brew install ghoto2”
  4. Eingangsmonitor starten
    #!/bin/sh
    fswatch -xn /Users/xxx/Desktop/Original/ | (while read file event; do
     fileout=$(echo $file | sed -e "s/Original/Server/g" | sed -e "s/nef/jpg/g")
     while [ `lsof -t $file` > 0 ]; do sleep .1; done
     sips -s format jpeg -s formatOptions 80  --resampleWidth 1000 $file --out $fileout;
    done)
    
  5. Primäre Ansicht am Beamer mit Chrome Vollbild von Superslides. In Sekundenabstand via Ajax das neueste JPG holen. Skript auf Anfrage.
    Kamera auslösen über Infrarot Sender -> USB Receiver -> Chrome -> Keydown Event -> Ajax -> shoot.php -> Terminal -> Gphoto2.

    $output = shell_exec("gphoto2 --capture-image-and-download");
    
  6. Sekundäre Ansicht an mobile Devices
    $files = preg_grep('~\.(jpg)$~', scandir('.', SCANDIR_SORT_DESCENDING));
    foreach($files as $img) {		
    	echo '<a href="copy/' . $img . '"><img src="thumbs/' . $img . '"></a> 
     <a href="download.php?fn=' . $img . '">download ' . $img . '</a>
    ';
    }