public function crop($width = null, $heigth = null, array $options = [])
    {
        $heigth = $heigth ?: $width;
        $width = $width ?: $heigth;

        //Sets default options
        $options += ['x' => null, 'y' => null];

        //Adds arguments
        $this->arguments[] = [__FUNCTION__, $width, $heigth, $options];

        //Adds the callback
        $this->callbacks[] = function (Image $imageInstance) use ($width, $heigth, $options) {
            return $imageInstance->crop($width, $heigth, $options['x'], $options['y']);
        };

        return $this;
    }
public function crop($width = null, $heigth = null, array $options = [])
    {
        $heigth = $heigth ?: $width;
        $width = $width ?: $heigth;

        //Sets default options
        $options += ['x' => null, 'y' => null];

        //Adds arguments
        $this->arguments[] = [__FUNCTION__, $width, $heigth, $options];

        //Adds the callback
        $this->callbacks[] = function (Image $imageInstance) use ($width, $heigth, $options) {
            return $imageInstance->crop($width, $heigth, $options['x'], $options['y']);
        };

        return $this;
    }
public function crop ( $ width = null , $ heigth = null , array $ options = [ ] ) { $ heigth = $ heigth ? : $ width ; $ width = $ width ? : $ heigth ; //Sets default options $ options += [ 'x' => null , 'y' => null ] ; //Adds arguments $ this -> arguments [ ] = [ __FUNCTION__ , $ width , $ heigth , $ options ] ; //Adds the callback $ this -> callbacks [ ] = function ( Image $ imageInstance ) use ( $ width , $ heigth , $ options ) { return $ imageInstance -> crop ( $ width , $ heigth , $ options [ 'x' ] , $ options [ 'y' ] ) ; } ; return $ this ; }
Crops the image, cutting out a rectangular part of the image.

You can define optional coordinates to move the top-left corner of the
cutout to a certain position.
@param int $width Required width
@param int $heigth Required heigth
@param array $options Options for the thumbnail
@return \Thumber\Utility\ThumbCreator
@see https://github.com/mirko-pagliai/cakephp-thumber/wiki/How-to-uses-the-ThumbCreator-utility#crop
@uses $arguments
@uses $callbacks
Crops the image cutting out a rectangular part of the image .