fix media type allocations
This commit is contained in:
parent
4d5f9f7de0
commit
4342506e5b
|
@ -57,7 +57,7 @@ $filename = '';
|
||||||
$Frame = null;
|
$Frame = null;
|
||||||
$Event = null;
|
$Event = null;
|
||||||
$path = null;
|
$path = null;
|
||||||
$image_type='image/jpeg';
|
$media_type='image/jpeg';
|
||||||
|
|
||||||
if ( empty($_REQUEST['path']) ) {
|
if ( empty($_REQUEST['path']) ) {
|
||||||
|
|
||||||
|
@ -86,9 +86,10 @@ if ( empty($_REQUEST['path']) ) {
|
||||||
// we found the animation mp4 file
|
// we found the animation mp4 file
|
||||||
$path = $path_anim_mp4;
|
$path = $path_anim_mp4;
|
||||||
ZM\Logger::Debug("Animation file found at $path");
|
ZM\Logger::Debug("Animation file found at $path");
|
||||||
$image_type = 'video/mp4';
|
$media_type = 'video/mp4';
|
||||||
} else if (file_exists($path_anim_gif)) {
|
} else if (file_exists($path_anim_gif)) {
|
||||||
// we found the animation gif file
|
// we found the animation gif file
|
||||||
|
$media_type = 'image/gif';
|
||||||
ZM\Logger::Debug("Animation file found at $path");
|
ZM\Logger::Debug("Animation file found at $path");
|
||||||
$path = $path_anim_gif;
|
$path = $path_anim_gif;
|
||||||
} else if (file_exists($path_image)) {
|
} else if (file_exists($path_image)) {
|
||||||
|
@ -108,15 +109,18 @@ if ( empty($_REQUEST['path']) ) {
|
||||||
header('HTTP/1.0 404 Not Found');
|
header('HTTP/1.0 404 Not Found');
|
||||||
ZM\Fatal("File $path does not exist. You might not have enabled create_animation in objectconfig.ini. If you have, inspect debug logs for errors during creation");
|
ZM\Fatal("File $path does not exist. You might not have enabled create_animation in objectconfig.ini. If you have, inspect debug logs for errors during creation");
|
||||||
}
|
}
|
||||||
|
$Frame = new ZM\Frame();
|
||||||
|
$Frame->Id('objdetect');
|
||||||
|
$media_type = 'video/mp4';
|
||||||
} else if ( $_REQUEST['fid'] == 'objdetect_gif' ) {
|
} else if ( $_REQUEST['fid'] == 'objdetect_gif' ) {
|
||||||
$path = $Event->Path().'/objdetect.mp4';
|
$path = $Event->Path().'/objdetect.gif';
|
||||||
if ( !file_exists($path) ) {
|
if ( !file_exists($path) ) {
|
||||||
header('HTTP/1.0 404 Not Found');
|
header('HTTP/1.0 404 Not Found');
|
||||||
ZM\Fatal("File $path does not exist. You might not have enabled create_animation in objectconfig.ini. If you have, inspect debug logs for errors during creation");
|
ZM\Fatal("File $path does not exist. You might not have enabled create_animation in objectconfig.ini. If you have, inspect debug logs for errors during creation");
|
||||||
}
|
}
|
||||||
$Frame = new ZM\Frame();
|
$Frame = new ZM\Frame();
|
||||||
$Frame->Id('objdetect');
|
$Frame->Id('objdetect');
|
||||||
$image_type = 'video/mp4';
|
$media_type = 'image/gif';
|
||||||
} else if ( $_REQUEST['fid'] == 'objdetect_jpg' ) {
|
} else if ( $_REQUEST['fid'] == 'objdetect_jpg' ) {
|
||||||
$path = $Event->Path().'/objdetect.jpg';
|
$path = $Event->Path().'/objdetect.jpg';
|
||||||
if ( !file_exists($path) ) {
|
if ( !file_exists($path) ) {
|
||||||
|
|
Loading…
Reference in New Issue