src/classes/CCImage.php
public function resize_fit( $width, $height, $background_color = '#fff' ) 
	{
		$background = static::blank( $width, $height );

		// make out actual image max size
		static::resize_max( $width, $height );

		// make background white
		$background->fill_color( $background_color );

		// add the layer
		$background->add_layer( $this, 'center', 'middle' );

		// overwrite the image context 
		$this->image_context = $background->image_context;

		// update properties
		$this->width = $width; 
		$this->height = $height;

		// return self
		return $this;
	}
public function resize_fit( $width, $height, $background_color = '#fff' ) 
	{
		$background = static::blank( $width, $height );

		// make out actual image max size
		static::resize_max( $width, $height );

		// make background white
		$background->fill_color( $background_color );

		// add the layer
		$background->add_layer( $this, 'center', 'middle' );

		// overwrite the image context 
		$this->image_context = $background->image_context;

		// update properties
		$this->width = $width; 
		$this->height = $height;

		// return self
		return $this;
	}
public function resize_fit ( $ width , $ height , $ background_color = '#fff' ) { $ background = static :: blank ( $ width , $ height ) ; // make out actual image max size static :: resize_max ( $ width , $ height ) ; // make background white $ background -> fill_color ( $ background_color ) ; // add the layer $ background -> add_layer ( $ this , 'center' , 'middle' ) ; // overwrite the image context  $ this -> image_context = $ background -> image_context ; // update properties $ this -> width = $ width ; $ this -> height = $ height ; // return self return $ this ; }
Resize the image that it fits into a size doesn't crop adds a background layer

@param int 		$width
@param int 		$height
@return self
Resize the image that it fits into a size doesn t crop adds a background layer