From 317873afccbb2f9eb70a004c4103cfeaa8d46fbf Mon Sep 17 00:00:00 2001 From: stan Date: Mon, 16 Feb 2004 11:12:28 +0000 Subject: [PATCH] Clones annotated images before writing. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@862 e3e1d417-86f3-4887-817a-d78f3d33393f --- src/zm_event.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/zm_event.cpp b/src/zm_event.cpp index ec1e30611..da1717cbd 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -206,13 +206,21 @@ bool Event::SendFrameImage( const Image *image, bool alarm_frame ) bool Event::WriteFrameImage( Image *image, struct timeval timestamp, const char *event_file, bool alarm_frame ) { - if ( !timestamp_on_capture ) + if ( timestamp_on_capture ) { - monitor->TimestampImage( image, timestamp.tv_sec ); + if ( !(bool)config.Item( ZM_OPT_FRAME_SERVER ) || !SendFrameImage( image, alarm_frame) ) + { + image->WriteJpeg( event_file ); + } } - if ( !(bool)config.Item( ZM_OPT_FRAME_SERVER ) || !SendFrameImage( image, alarm_frame) ) + else { - image->WriteJpeg( event_file ); + Image ts_image( *image ); + monitor->TimestampImage( &ts_image, timestamp.tv_sec ); + if ( !(bool)config.Item( ZM_OPT_FRAME_SERVER ) || !SendFrameImage( image, alarm_frame) ) + { + ts_image.WriteJpeg( event_file ); + } } return( true ); }