src/Sulu/Bundle/MediaBundle/Media/ImageConverter/ImagineImageConverter.php
private function getCropParameters(ImageInterface $image, $formatOptions, array $format)
    {
        if (isset($formatOptions)) {
            $parameters = [
                'x' => $formatOptions->getCropX(),
                'y' => $formatOptions->getCropY(),
                'width' => $formatOptions->getCropWidth(),
                'height' => $formatOptions->getCropHeight(),
            ];

            if ($this->cropper->isValid(
                $image,
                $parameters['x'],
                $parameters['y'],
                $parameters['width'],
                $parameters['height'],
                $format
            )
            ) {
                return $parameters;
            }
        }

        return;
    }
private function getCropParameters(ImageInterface $image, $formatOptions, array $format)
    {
        if (isset($formatOptions)) {
            $parameters = [
                'x' => $formatOptions->getCropX(),
                'y' => $formatOptions->getCropY(),
                'width' => $formatOptions->getCropWidth(),
                'height' => $formatOptions->getCropHeight(),
            ];

            if ($this->cropper->isValid(
                $image,
                $parameters['x'],
                $parameters['y'],
                $parameters['width'],
                $parameters['height'],
                $format
            )
            ) {
                return $parameters;
            }
        }

        return;
    }
private function getCropParameters ( ImageInterface $ image , $ formatOptions , array $ format ) { if ( isset ( $ formatOptions ) ) { $ parameters = [ 'x' => $ formatOptions -> getCropX ( ) , 'y' => $ formatOptions -> getCropY ( ) , 'width' => $ formatOptions -> getCropWidth ( ) , 'height' => $ formatOptions -> getCropHeight ( ) , ] ; if ( $ this -> cropper -> isValid ( $ image , $ parameters [ 'x' ] , $ parameters [ 'y' ] , $ parameters [ 'width' ] , $ parameters [ 'height' ] , $ format ) ) { return $ parameters ; } } return ; }
Constructs the parameters for the cropper. Returns null when
the image should not be cropped.

@param ImageInterface $image
@param FormatOptions $formatOptions
@param array $format

@return array The crop parameters or null
Constructs the parameters for the cropper . Returns null when the image should not be cropped .