public function resize( $width, $height, $mode = null ) 
	{
		// check for alternative syntax 
		if ( strpos( $width, 'x' ) !== false ) 
		{
			// mode is the secound param
			$mode = $height;

			$dimensions = explode( 'x', $width );
			$width = $dimensions[0];
			$height = $dimensions[1];
		} 

		// default mode
		if ( is_null( $mode ) ) 
		{
			$mode = 'strict';
		}

		// auto width
		if ( $width == 'auto' ) 
		{
			$mode = 'portrait';
			// in this case the $height is the first param
			$width = $height;
		} 
		// auto height
		elseif ( $height == 'auto' ) 
		{
			$mode = 'landscape';
		} 

		$method = 'resize_'.$mode;

		if ( !method_exists( $this, $method ) ) 
		{
			throw new CCException( "CCImage::resize - Invalid resize method ".$mode."." );
		}

		return call_user_func_array( array( $this, $method ), array( $width, $height ) );
	}