From 6c547aba85ab8ff243b1fbf87f31315f20666ba0 Mon Sep 17 00:00:00 2001 From: stan Date: Sun, 28 Nov 2010 21:20:02 +0000 Subject: [PATCH] Fixed use of analysis images in getImageSrc function plus fixed implementation of overwrite flag in various functions. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@3207 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/includes/functions.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index 3552846b0..7eef8fbca 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -1105,12 +1105,13 @@ function getImageSrc( $event, $frame, $scale=SCALE_BASE, $captureOnly=false, $ov $analImage = sprintf( "%0".ZM_EVENT_IMAGE_DIGITS."d-analyse.jpg", $frame['FrameId'] ); $analPath = $eventPath.'/'.$analImage; + $analFile = ZM_DIR_EVENTS."/".$analPath; $thumbAnalPath = ZM_DIR_IMAGES.'/'.$event['Id'].'-'.$analImage; //echo "AI:$analImage, AP:$analPath, TAP:$thumbAnalPath
"; $alarmFrame = $frame['Type']=='Alarm'; - $hasAnalImage = $alarmFrame && file_exists( $analPath ) && filesize( $analPath ); + $hasAnalImage = $alarmFrame && file_exists( $analFile ) && filesize( $analFile ); $isAnalImage = $hasAnalImage && !$captureOnly; if ( !ZM_WEB_SCALE_THUMBS || $scale >= SCALE_BASE || !function_exists( 'imagecreatefromjpeg' ) ) @@ -1144,7 +1145,7 @@ function getImageSrc( $event, $frame, $scale=SCALE_BASE, $captureOnly=false, $ov $imageFile = ZM_DIR_EVENTS."/".$imagePath; //$thumbFile = ZM_DIR_EVENTS."/".$thumbPath; $thumbFile = $thumbPath; - if ( !file_exists( $thumbFile ) || !filesize( $thumbFile ) ) + if ( $overwrite || !file_exists( $thumbFile ) || !filesize( $thumbFile ) ) { // Get new dimensions list( $imageWidth, $imageHeight ) = getimagesize( $imageFile ); @@ -1216,7 +1217,7 @@ function createListThumbnail( $event, $overwrite=false ) die( "No thumbnail width or height specified, please check in Options->Web" ); } - $imageData = getImageSrc( $event, $frame, $scale ); + $imageData = getImageSrc( $event, $frame, $scale, false, $overwrite ); $thumbData = $frame; $thumbData['Path'] = $imageData['thumbPath']; $thumbData['Width'] = (int)$thumbWidth;