src/classes/CCImage.php
public function resize_max( $width, $height ) 
	{
		$new_width = $this->width;
		$new_height = $this->height;

		if ( $new_width > $width ) 
		{
			// set new with
			$new_width = $width;
			// calculate height
			$new_height = $new_width * ( $this->height / $this->width );
		}

		if ( $new_height > $height ) 
		{
			// set new height
			$new_height = $height;
			// calculate width
			$new_width = $new_height * ( $this->width / $this->height );
		}

		return $this->resize_strict( $new_width, $new_height );
	}
public function resize_max( $width, $height ) 
	{
		$new_width = $this->width;
		$new_height = $this->height;

		if ( $new_width > $width ) 
		{
			// set new with
			$new_width = $width;
			// calculate height
			$new_height = $new_width * ( $this->height / $this->width );
		}

		if ( $new_height > $height ) 
		{
			// set new height
			$new_height = $height;
			// calculate width
			$new_width = $new_height * ( $this->width / $this->height );
		}

		return $this->resize_strict( $new_width, $new_height );
	}
public function resize_max ( $ width , $ height ) { $ new_width = $ this -> width ; $ new_height = $ this -> height ; if ( $ new_width > $ width ) { // set new with $ new_width = $ width ; // calculate height $ new_height = $ new_width * ( $ this -> height / $ this -> width ) ; } if ( $ new_height > $ height ) { // set new height $ new_height = $ height ; // calculate width $ new_width = $ new_height * ( $ this -> width / $ this -> height ) ; } return $ this -> resize_strict ( $ new_width , $ new_height ) ; }
Resize the image that it fits into a size doesn't crop and does not add a border

@param int 		$width
@param int 		$height
@return self
Resize the image that it fits into a size doesn t crop and does not add a border