From bcb7dd1ba400a3ca861059f5f0515d0e35a1abb4 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 12 Aug 2016 15:16:05 -0400 Subject: [PATCH] take optional show= to specify the analyse image or the capture image --- web/views/image.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/views/image.php b/web/views/image.php index 9bc242244..0135df7e0 100644 --- a/web/views/image.php +++ b/web/views/image.php @@ -61,18 +61,19 @@ $errorText = false; if ( empty($_REQUEST['path']) ) { if ( ! empty($_REQUEST['fid']) ) { + $show = empty($_REQUEST['show']) ? 'capture' : $_REQUEST['show']; if ( ! empty($_REQUEST['eid'] ) ) { $Event = new Event( $_REQUEST['eid'] ); $Frame = Frame::find_one( array( 'EventId' => $_REQUEST['eid'], 'FrameId' => $_REQUEST['fid'] ) ); if ( ! $Frame ) { Fatal("No Frame found for event(".$_REQUEST['eid'].") and frame id(".$_REQUEST['fid'].")"); } - $path = $Event->Path().'/'.sprintf("%'.0".ZM_EVENT_IMAGE_DIGITS.'d',$_REQUEST['fid']).'-capture.jpg'; + $path = $Event->Path().'/'.sprintf("%'.0".ZM_EVENT_IMAGE_DIGITS.'d',$_REQUEST['fid']).'-'.$show.'.jpg'; } else { # If we are only specifying fid, then the fid must be the primary key into the frames table. But when the event is specified, then it is the frame # $Frame = new Frame( $_REQUEST['fid'] ); $Event = new Event( $Frame->EventId() ); - $path = $Event->Path().'/'.sprintf("%'.0".ZM_EVENT_IMAGE_DIGITS.'d',$Frame->FrameId()).'-capture.jpg'; + $path = $Event->Path().'/'.sprintf("%'.0".ZM_EVENT_IMAGE_DIGITS.'d',$Frame->FrameId()).'-'.$show.'.jpg'; } } else { $errorText = "No image path";