public static function _Resize ($image, $newX, $newY, $method = self::RESIZE_MAX, $proportional = TRUE)
	{
		
		// Get original image sizes
		
		$origX	= imagesx ($image);
		$origY	= imagesy ($image);
		
		// Set canvas sizes
		
		$canvasX	= $newX;
		$canvasY	= $newY;
		
		// Switch method
		
		switch ($method)
		{
			
			// Maximum Resize
			
			case self::RESIZE_MAX:
				
				// If the width is relatively bigger than the height
				
				if ($origX / $newX > $origY / $newY)
				{
					
					// Resize the image so the width is the max
					
					$newY		= ($newX / $origX) * $origY;
					$canvasY	= $newY;
					
				}
				
				// Else the height is bigger than the width
				
				else
				{
					
					// Resize the image so the height is the max
					
					$newX		= ($newY / $origY) * $origX;
					$canvasX	= $newX;
					
				}
				
				// Break
				
				break;
				
			
			// Minimum resize
			
			case self::RESIZE_MIN:
				
				// If the width is relatively bigger than the height
				
				if ($origX / $newX > $origY / $newY)
				{
					
					// Resize the image so the height is the max
					
					$newX		= ($newY / $origY) * $origX;
					$canvasX	= $newX;
					
				}
				
				// Else the height is bigger than the width
				
				else
				{
					
					// Resize the image so the width is the max
					
					$newY		= ($newX / $origX) * $origY;
					$canvasY	= $newY;
					
				}
				
				// Break
				
				break;
				
			
			// Exact resize
			
			case self::RESIZE_EXACT:
				
				// If proportional
				
				if ($proportional)
				{
					
					// If the original width is bigger
					
					if ($origX / $newX > $origY / $newY)
					{
						
						// Resize the image so the width is the max
						
						$newY	= ($newX / $origX) * $origY;
						
					}
					
					// Else the height is bigger than the width
					
					else
					{
						
						// Resize the image so the height is the max
						
						$newX	= ($newY / $origY) * $origX;
						
					}
					
				}
				
				// Break
				
				break;


			// Exact resize with cropping

			case self::RESIZE_CROP:

				// If proportional

				if ($proportional)
				{

					// If the width is relatively bigger than the height

					if ($origX / $newX > $origY / $newY)
					{

						// Resize the image and crop

						$newX	= ($newY / $origY) * $origX;

					}

					// Else the height is bigger than the width

					else
					{

						// Resize the image and crop

						$newY	= ($newX / $origX) * $origY;

					}

				}

				// Break

				break;

		}
		
		// Calculate new image position to center
		
		$posX	= ($canvasX - $newX) / 2;
		$posY	= ($canvasY - $newY) / 2;

		// Copy image and create new resized image
		
		$newImage		= imagecreatetruecolor ($canvasX, $canvasY);
		
		// Set white colour
		
		$colourWhite	= imagecolorallocate ($newImage, 0xFF, 0xFF, 0xFF);
		
		// Set background
		
		imagefill ($newImage, 0, 0, $colourWhite);
		
		// Resize and resample image
		
		imagecopyresampled ($newImage, $image, $posX, $posY, 0, 0, $newX, $newY, $origX, $origY);
		
		// Return new image
		
		return $newImage;
		
	}