src/UI/Image/Processing.php
public function scaleToRange( $minWidth, $minHeight, $maxWidth, $maxHeight, $interpolate = TRUE )
	{
		$width	= $this->image->getWidth();
		$height	= $this->image->getHeight();
		if( $width < $minWidth || $height < $minHeight )
			return $this->scaleUpToLimit( $minWidth, $minHeight, $interpolate );
		else if( $width > $maxWidth || $height > $maxHeight )
			return $this->scaleDownToLimit( $maxWidth, $maxHeight, $interpolate );
		return FALSE;
	}
public function scaleToRange( $minWidth, $minHeight, $maxWidth, $maxHeight, $interpolate = TRUE )
	{
		$width	= $this->image->getWidth();
		$height	= $this->image->getHeight();
		if( $width < $minWidth || $height < $minHeight )
			return $this->scaleUpToLimit( $minWidth, $minHeight, $interpolate );
		else if( $width > $maxWidth || $height > $maxHeight )
			return $this->scaleDownToLimit( $maxWidth, $maxHeight, $interpolate );
		return FALSE;
	}
public function scaleToRange ( $ minWidth , $ minHeight , $ maxWidth , $ maxHeight , $ interpolate = TRUE ) { $ width = $ this -> image -> getWidth ( ) ; $ height = $ this -> image -> getHeight ( ) ; if ( $ width < $ minWidth || $ height < $ minHeight ) return $ this -> scaleUpToLimit ( $ minWidth , $ minHeight , $ interpolate ) ; else if ( $ width > $ maxWidth || $ height > $ maxHeight ) return $ this -> scaleDownToLimit ( $ maxWidth , $ maxHeight , $ interpolate ) ; return FALSE ; }
Scale image to fit into a size range.
Reduces to maximum size after possibly enlarging to minimum size.
Range maximum has higher priority.
For better resolution this method will first maximize and than minimize if both is needed.
@access		public
@param		integer		$minWidth		Minimum width
@param		integer		$minHeight		Minimum height
@param		integer		$maxWidth		Maximum width
@param		integer		$maxHeight		Maximum height
@param		boolean		$interpolate	Flag: use interpolation
@return		boolean		Image has been scaled
Scale image to fit into a size range . Reduces to maximum size after possibly enlarging to minimum size . Range maximum has higher priority . For better resolution this method will first maximize and than minimize if both is needed .