Skip to content
Snippets Groups Projects
Commit 86b0fc7f authored by John Hodge's avatar John Hodge Committed by webcam
Browse files

Support sub-minute images in archive.php

parent c2e43e2a
Branches
No related merge requests found
......@@ -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
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment