diff --git a/web/views/image.php b/web/views/image.php index baa8b94cb..6d25eeb7c 100644 --- a/web/views/image.php +++ b/web/views/image.php @@ -78,16 +78,12 @@ if ( empty($_REQUEST['path']) ) { } if ( $_REQUEST['fid'] == 'objdetect' ) { - $Event = new Event($_REQUEST['eid']); - $path = $Event->Path().'/objdetect.jpg'; - unset($Event); # we don't want event object related processing later for this case - if ( !file_exists($path)) { + $path = $Event->Path().'/objdetect.jpg'; + if ( !file_exists($path)) { header('HTTP/1.0 404 Not Found'); - Fatal("File ".$path." does not exist. Please make sure store_frame_in_zm is enabled in the object detection config"); + Fatal("File $path does not exist. Please make sure store_frame_in_zm is enabled in the object detection config"); } - - } - else if ( $_REQUEST['fid'] == 'alarm' ) { + } else if ( $_REQUEST['fid'] == 'alarm' ) { # look for first alarmed frame $Frame = Frame::find_one(array('EventId'=>$_REQUEST['eid'], 'Type'=>'Alarm'), array('order'=>'FrameId ASC')); @@ -107,8 +103,7 @@ if ( empty($_REQUEST['path']) ) { } else { $path = $Event->Path().'/alarm.jpg'; } - } - else if ( $_REQUEST['fid'] == 'snapshot' ) { + } else if ( $_REQUEST['fid'] == 'snapshot' ) { $Frame = Frame::find_one(array('EventId'=>$_REQUEST['eid'], 'Score'=>$Event->MaxScore())); if ( !$Frame ) $Frame = Frame::find_one(array('EventId'=>$_REQUEST['eid']));