protected function _getSizeFitted( $srcWidth, $srcHeight, $destWidth, $destHeight )
	{
		$destWidth = ( $destWidth === null ? $srcWidth : $destWidth );
		$destHeight = ( $destHeight === null ? $srcHeight : $destHeight );

		$wRatio = $srcWidth / $destWidth;
		$hRatio = $srcHeight / $destHeight;

		if( $wRatio > $hRatio ) {
			$destHeight = round( $srcHeight / $wRatio );
		} else {
			$destWidth = round( $srcWidth / $hRatio );
		}

		return array( $destWidth, $destHeight );
	}
protected function _getSizeFitted( $srcWidth, $srcHeight, $destWidth, $destHeight )
	{
		$destWidth = ( $destWidth === null ? $srcWidth : $destWidth );
		$destHeight = ( $destHeight === null ? $srcHeight : $destHeight );

		$wRatio = $srcWidth / $destWidth;
		$hRatio = $srcHeight / $destHeight;

		if( $wRatio > $hRatio ) {
			$destHeight = round( $srcHeight / $wRatio );
		} else {
			$destWidth = round( $srcWidth / $hRatio );
		}

		return array( $destWidth, $destHeight );
	}
protected function _getSizeFitted ( $ srcWidth , $ srcHeight , $ destWidth , $ destHeight ) { $ destWidth = ( $ destWidth === null ? $ srcWidth : $ destWidth ) ; $ destHeight = ( $ destHeight === null ? $ srcHeight : $ destHeight ) ; $ wRatio = $ srcWidth / $ destWidth ; $ hRatio = $ srcHeight / $ destHeight ; if ( $ wRatio > $ hRatio ) { $ destHeight = round ( $ srcHeight / $ wRatio ) ; } else { $ destWidth = round ( $ srcWidth / $ hRatio ) ; } return array ( $ destWidth , $ destHeight ) ; }
Returns the fitted width and height.

@param integer $srcWidth Width of the image
@param integer $srcHeight Height of the image
@param integer $destWidth New width of the image
@param integer $destHeight New height of the image
@return array Array containing the new width at position 0 and the new height as position 1
Returns the fitted width and height .