diff --git a/web/zm_funcs.php b/web/zm_funcs.php index cb96ab105..2bf65cacd 100644 --- a/web/zm_funcs.php +++ b/web/zm_funcs.php @@ -932,10 +932,11 @@ function getImageSrc( $event, $frame, $scale, $capture_only=false, $overwrite=fa } else { - $fraction = sprintf( "%.3f", $scale/100 ); - //echo "F:$fraction
"; + 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
"; $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 ); diff --git a/web/zm_xhtml_view_event.php b/web/zm_xhtml_view_event.php index a30a47fff..38300ecd3 100644 --- a/web/zm_xhtml_view_event.php +++ b/web/zm_xhtml_view_event.php @@ -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++ ) { diff --git a/web/zm_xhtml_view_eventdetails.php b/web/zm_xhtml_view_eventdetails.php index 8d86f38d0..33ece3c60 100644 --- a/web/zm_xhtml_view_eventdetails.php +++ b/web/zm_xhtml_view_eventdetails.php @@ -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 ); diff --git a/web/zm_xhtml_view_video.php b/web/zm_xhtml_view_video.php index 32c17787a..85d808f92 100644 --- a/web/zm_xhtml_view_video.php +++ b/web/zm_xhtml_view_video.php @@ -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 );