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

Support zip compressed month/days

parent 19f02e4a
Branches
No related merge requests found
...@@ -53,6 +53,36 @@ ...@@ -53,6 +53,36 @@
passthru($cmd); passthru($cmd);
exit(); exit();
} }
$zipfile_day = $month_folder . $timestamp->format("Ymd").".zip";
if( is_readable($zipfile_day) ) {
$zip = new ZipArchive;
$zip->open($zipfile_day);
$iname = $timestamp->format("d/H/i").".jpg";
$c = $zip->getFromName($iname);
if($c !== false) {
header("Content-Type: image/jpeg");
header("Content-Length: ".strlen($c));
header("Last-Modified: ".gmdate("D, d M Y H:i:s", filectime($zipfile_day))." GMT");
echo $c;
exit();
}
}
$zipfile_month = "archive/" . $camera . "/" . $timestamp->format("Ym").".zip";
if( is_readable($zipfile_month) ) {
$zip = new ZipArchive;
$zip->open($zipfile_month);
$c = $zip->getFromName($timestamp->format("Ym/d/H/i").".jpg");
if($c !== false) {
header("Content-Type: image/jpeg");
header("Content-Length: ".strlen($c));
header("Last-Modified: ".gmdate("D, d M Y H:i:s", filectime($zipfile_month))." GMT");
echo $c;
exit();
}
}
$file = $month_folder . $timestamp->format("d/H/") . $timestamp->format("i").".jpg"; $file = $month_folder . $timestamp->format("d/H/") . $timestamp->format("i").".jpg";
//header("X-WebcamFile: {$file}"); //header("X-WebcamFile: {$file}");
} }
......
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