Fixed problem with thumbnails not being generated.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@36 e3e1d417-86f3-4887-817a-d78f3d33393f
pull/27/merge
stan 2002-09-23 12:47:04 +00:00
parent f2366a4a96
commit 6011a7f0e0
1 changed files with 4 additions and 4 deletions

View File

@ -834,9 +834,9 @@ else
$frame_id = $row[FrameId]; $frame_id = $row[FrameId];
$image_path = $row[ImagePath]; $image_path = $row[ImagePath];
$capt_image = $image_path;
if ( $scale == 1 ) if ( $scale == 1 )
{ {
$capt_image = $image_path;
$anal_image = preg_replace( "/capture/", "analyse", $image_path ); $anal_image = preg_replace( "/capture/", "analyse", $image_path );
if ( file_exists($anal_image) && filesize( $anal_image ) ) if ( file_exists($anal_image) && filesize( $anal_image ) )
@ -850,15 +850,15 @@ else
} }
else else
{ {
$thumb_image = preg_replace( "/capture/", "thumb", $image_path ); $thumb_image = preg_replace( "/capture/", "thumb", $capt_image );
if ( !file_exists($thumb_image) || !filesize( $thumb_image ) ) if ( !file_exists($thumb_image) || !filesize( $thumb_image ) )
{ {
$anal_image = preg_replace( "/capture/", "analyse", $image ); $anal_image = preg_replace( "/capture/", "analyse", $capt_image );
if ( file_exists( $anal_image ) ) if ( file_exists( $anal_image ) )
$command = "jpegtopnm -dct fast $anal_image | pnmscalefixed $fraction | ppmtojpeg --dct=fast > $thumb_image"; $command = "jpegtopnm -dct fast $anal_image | pnmscalefixed $fraction | ppmtojpeg --dct=fast > $thumb_image";
else else
$command = "jpegtopnm -dct fast $image | pnmscalefixed $fraction | ppmtojpeg --dct=fast > $thumb_image"; $command = "jpegtopnm -dct fast $capt_image | pnmscalefixed $fraction | ppmtojpeg --dct=fast > $thumb_image";
#exec( escapeshellcmd( $command ) ); #exec( escapeshellcmd( $command ) );
exec( $command ); exec( $command );
} }