mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-27 16:58:31 -04:00
Bug 299 - Changed sprintf to use %F where version > 4.3.10
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1895 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
1 parent
84751f6356
commit
6230ea5f49
4 files changed
+23
-8
No files matched your search
+8
-4
@@ -932,10 +932,11 @@ function getImageSrc( $event, $frame, $scale, $capture_only=false, $overwrite=fa
|
||||
}
|
||||
else
|
||||
{
|
||||
$fraction = sprintf( "%.3f", $scale/100 );
|
||||
//echo "F:$fraction<br>";
|
||||
if ( version_compare( phpversion(), "4.3.10", ">=") )
|
||||
$fraction = sprintf( "%.3F", $scale/100 );
|
||||
else
|
||||
$fraction = sprintf( "%.3f", $scale/100 );
|
||||
$scale = (int)round( $scale );
|
||||
//echo "S:$scale<br>";
|
||||
|
||||
$thumb_capt_path = preg_replace( "/\.jpg$/", "-$scale.jpg", $thumb_capt_path );
|
||||
$thumb_anal_path = preg_replace( "/\.jpg$/", "-$scale.jpg", $thumb_anal_path );
|
||||
@@ -1016,7 +1017,10 @@ function createListThumbnail( $event, $overwrite=false )
|
||||
|
||||
function createVideo( $event, $format, $rate, $scale, $overwrite=false )
|
||||
{
|
||||
$command = ZM_PATH_BIN."/zmvideo.pl -e ".$event['Id']." -f ".$format." -r ".sprintf( "%.2f", ($rate/RATE_BASE) )." -s ".sprintf( "%.2f", ($scale/SCALE_BASE) );
|
||||
if ( version_compare( phpversion(), "4.3.10", ">=") )
|
||||
$command = ZM_PATH_BIN."/zmvideo.pl -e ".$event['Id']." -f ".$format." -r ".sprintf( "%.2F", ($rate/RATE_BASE) )." -s ".sprintf( "%.2F", ($scale/SCALE_BASE) );
|
||||
else
|
||||
$command = ZM_PATH_BIN."/zmvideo.pl -e ".$event['Id']." -f ".$format." -r ".sprintf( "%.2f", ($rate/RATE_BASE) )." -s ".sprintf( "%.2f", ($scale/SCALE_BASE) );
|
||||
if ( $overwrite )
|
||||
$command .= " -o";
|
||||
$result = exec( $command, $output, $status );
|
||||
|
||||
@@ -250,7 +250,10 @@ $scale = (int)(($width_scale<$height_scale)?$width_scale:$height_scale);
|
||||
$scale /= $frames_per_line; // Try and get two pics per line
|
||||
|
||||
$count = 0;
|
||||
$fraction = sprintf( "%.2f", $scale/100 );
|
||||
if ( version_compare( phpversion(), "4.3.10", ">=") )
|
||||
$fraction = sprintf( "%.2F", $scale/100 );
|
||||
else
|
||||
$fraction = sprintf( "%.2f", $scale/100 );
|
||||
$event_path = ZM_DIR_EVENTS.'/'.$event['MonitorName'].'/'.$event['Id'];
|
||||
for ( $frame_id = $lo_frame_id; $frame_id <= $hi_frame_id; $frame_id++, $count++ )
|
||||
{
|
||||
|
||||
@@ -78,10 +78,15 @@ function getThumbnail( $event, $fid, $scale )
|
||||
|
||||
if ( !file_exists($thumb_image) || !filesize( $thumb_image ) )
|
||||
{
|
||||
$fraction = sprintf( "%.2f", $scale/100 );
|
||||
if ( version_compare( phpversion(), "4.3.10", ">=") )
|
||||
$fraction = sprintf( "%.2F", $scale/100 );
|
||||
else
|
||||
$fraction = sprintf( "%.2f", $scale/100 );
|
||||
if ( file_exists( $image_path ) )
|
||||
{
|
||||
$command = ZM_PATH_NETPBM."/jpegtopnm -dct fast $image_path | ".ZM_PATH_NETPBM."/pnmscalefixed $fraction | ".ZM_PATH_NETPBM."/ppmtojpeg --dct=fast > $thumb_image";
|
||||
exec( $command );
|
||||
exec( $command );
|
||||
}
|
||||
}
|
||||
}
|
||||
return( $thumb_image );
|
||||
|
||||
@@ -97,7 +97,10 @@ else
|
||||
|
||||
if ( !empty($generate) )
|
||||
{
|
||||
$command = ZM_PATH_BIN."/zmvideo.pl -e ".$event['Id']." -f ".$video_format." -r ".sprintf( "%.2f", ($rate/RATE_BASE) )." -S ".$video_size;
|
||||
if ( version_compare( phpversion(), "4.3.10", ">=") )
|
||||
$command = ZM_PATH_BIN."/zmvideo.pl -e ".$event['Id']." -f ".$video_format." -r ".sprintf( "%.2F", ($rate/RATE_BASE) )." -S ".$video_size;
|
||||
else
|
||||
$command = ZM_PATH_BIN."/zmvideo.pl -e ".$event['Id']." -f ".$video_format." -r ".sprintf( "%.2f", ($rate/RATE_BASE) )." -S ".$video_size;
|
||||
if ( $overwrite )
|
||||
$command .= " -o";
|
||||
$generated = exec( $command, $output, $status );
|
||||
|
||||
Reference in new issue
Block a user