diff --git a/archive.php b/archive.php index 84ac8feacda325c760c8bee6df89a7bf1fc3fd90..7030541dd0205dd12cbe743adcd6c7bc6f4869ef 100644 --- a/archive.php +++ b/archive.php @@ -27,6 +27,7 @@ ); $camera = (isset($_GET['camera']) ? $_GET['camera'] : 'nocamera'); + $sub_min = (isset($_GET['sub']) ? $_GET['sub'] : null); $timestamp = (isset($_GET['timestamp']) ? DateTime::createFromFormat("Ymd-Hi", $_GET['timestamp']) : null); // check camera is approved - mtearle @@ -84,7 +85,12 @@ } } - $file = $month_folder . $timestamp->format("d/H/") . $timestamp->format("i").".jpg"; + // Support 6-second images (suffixed with -\d.jpg) + $file = $month_folder . $timestamp->format("d/H/") . $timestamp->format("i"); + if( !($sub_min === null) ) { + $file .= "-".$sub_min; + } + $file .= ".jpg"; //header("X-WebcamFile: {$file}"); } // If the image isn't available, emit "nocamera.jpg" with a 404 code