system/Images/Handlers/BaseHandler.php
public function crop(int $width = null, int $height = null, int $x = null, int $y = null, bool $maintainRatio = false, string $masterDim = 'auto')
	{
		$this->width  = $width;
		$this->height = $height;
		$this->xAxis  = $x;
		$this->yAxis  = $y;

		if ($maintainRatio)
		{
			$this->masterDim = $masterDim;
			$this->reproportion();
		}

		$result = $this->_crop();

		$this->xAxis = null;
		$this->yAxis = null;

		return $result;
	}
public function crop(int $width = null, int $height = null, int $x = null, int $y = null, bool $maintainRatio = false, string $masterDim = 'auto')
	{
		$this->width  = $width;
		$this->height = $height;
		$this->xAxis  = $x;
		$this->yAxis  = $y;

		if ($maintainRatio)
		{
			$this->masterDim = $masterDim;
			$this->reproportion();
		}

		$result = $this->_crop();

		$this->xAxis = null;
		$this->yAxis = null;

		return $result;
	}
Crops the image to the desired height and width. If one of the height/width values
is not provided, that value will be set the appropriate value based on offsets and
image dimensions.

@param integer|null $width
@param integer|null $height
@param integer|null $x             X-axis coord to start cropping from the left of image
@param integer|null $y             Y-axis coord to start cropping from the top of image
@param boolean      $maintainRatio
@param string       $masterDim

@return mixed