diff --git a/docs/userguide/filterevents.rst b/docs/userguide/filterevents.rst index 436034da0..ae1b4b132 100644 --- a/docs/userguide/filterevents.rst +++ b/docs/userguide/filterevents.rst @@ -70,13 +70,17 @@ Here is what the filter window looks like * %EPS% Path to the event stream * %EPF1% Path to the frame view for the first alarmed event image * %EPFM% Path to the frame view for the (first) event image with the highest score - * %EFMOD% Path to image containing object detection, in frame view + * %EPFMOD% Path to image containing object detection, in frame view + * %EPFMODG% Path to image containing object detection animated gif version, in frame view * %EPI% Path to the event images * %EPI1% Path to the first alarmed event image, suitable for use in img tags * %EPIM% Path to the (first) event image with the highest score, suitable for use in img tags - * %EIMOD% Path to image containing object detection, suitable for use in img tags + * %EPIMOD% Path to image containing object detection, suitable for use in img tags + * %EPIMODG% Path to image containing object detection animated gif version, suitable for use in img tags * %EI1% Attach first alarmed event image * %EIM% Attach (first) event image with the highest score + * %EIMOD% Attach image containing object detection + * %EIMODG% Attach image containing object detection animated gif version * %EV% Attach event mpeg video * %MN% Name of the monitor * %MET% Total number of events for the monitor diff --git a/scripts/zmfilter.pl.in b/scripts/zmfilter.pl.in index aaabedc8b..60d6293b4 100644 --- a/scripts/zmfilter.pl.in +++ b/scripts/zmfilter.pl.in @@ -668,7 +668,7 @@ sub substituteTags { my $Status = $Monitor->Status() if $need_status; # Do we need the image information too? - my $need_images = $text =~ /%(?:EPI1|EPIM|EI1|EIM|EI1A|EIMA|EIMOD)%/; + my $need_images = $text =~ /%(?:EPI1|EPIM|EI1|EIM|EI1A|EIMA|EIMOD|EIMODG)%/; my $first_alarm_frame; my $max_alarm_frame; my $max_alarm_score = 0; @@ -726,6 +726,11 @@ sub substituteTags { $text =~ s/%EPFM%/$url?view=frame&mid=$Event->{MonitorId}&eid=$Event->{Id}&fid=$max_alarm_frame->{FrameId}/g; $text =~ s/%EPI1%/$url?view=image&mid=$Event->{MonitorId}&eid=$Event->{Id}&fid=$first_alarm_frame->{FrameId}/g; $text =~ s/%EPIM%/$url?view=image&mid=$Event->{MonitorId}&eid=$Event->{Id}&fid=$max_alarm_frame->{FrameId}/g; + $text =~ s/%EPFMOD%/$url?view=frame&mid=$Event->{MonitorId}&eid=$Event->{Id}&fid=objdetect/g; + $text =~ s/%EPIMOD%/$url?view=image&mid=$Event->{MonitorId}&eid=$Event->{Id}&fid=objdetect/g; + $text =~ s/%EPFMODG%/$url?view=frame&mid=$Event->{MonitorId}&eid=$Event->{Id}&fid=objdetect_gif/g; + $text =~ s/%EPIMODG%/$url?view=image&mid=$Event->{MonitorId}&eid=$Event->{Id}&fid=objdetect_gif/g; + if ( $attachments_ref ) { if ( $text =~ s/%EI1%//g ) { my $path = generateImage($Event, $first_alarm_frame); @@ -773,9 +778,7 @@ sub substituteTags { } } - if ( $text =~ s/%EIMOD%//g or $text =~ s/%EFMOD%//g ) { - $text =~ s/%EFMOD%/$url?view=frame&mid=$Event->{MonitorId}&eid=$Event->{Id}&fid=objdetect/g; - $text =~ s/%EIMOD%/$url?view=image&mid=$Event->{MonitorId}&eid=$Event->{Id}&fid=objdetect/g; + if ( $text =~ s/%EIMOD%//g ) { my $path = $Event->Path().'/objdetect.jpg'; if ( -e $path ) { push @$attachments_ref, { type=>'image/jpeg', path=>$path }; @@ -784,6 +787,15 @@ sub substituteTags { } } + if ( $text =~ s/%EIMODG%//g ) { + my $path = $Event->Path().'/objdetect.gif'; + if ( -e $path ) { + push @$attachments_ref, { type=>'image/gif', path=>$path }; + } else { + Warning('No image for MODG at '.$path); + } + } + } # end if attachments_ref } # end if $first_alarm_frame