src/Sulu/Bundle/MediaBundle/Media/ImageConverter/Cropper/Cropper.php
private function isInsideImage(ImageInterface $image, $x, $y, $width, $height)
    {
        if ($x < 0 || $y < 0) {
            return false;
        }
        if ($x + $width > $image->getSize()->getWidth()) {
            return false;
        }
        if ($y + $height > $image->getSize()->getHeight()) {
            return false;
        }

        return true;
    }
private function isInsideImage(ImageInterface $image, $x, $y, $width, $height)
    {
        if ($x < 0 || $y < 0) {
            return false;
        }
        if ($x + $width > $image->getSize()->getWidth()) {
            return false;
        }
        if ($y + $height > $image->getSize()->getHeight()) {
            return false;
        }

        return true;
    }
private function isInsideImage ( ImageInterface $ image , $ x , $ y , $ width , $ height ) { if ( $ x < 0 || $ y < 0 ) { return false ; } if ( $ x + $ width > $ image -> getSize ( ) -> getWidth ( ) ) { return false ; } if ( $ y + $ height > $ image -> getSize ( ) -> getHeight ( ) ) { return false ; } return true ; }
Returns true iff the cropping does not exceed the image borders.

@param ImageInterface $image
@param $x
@param $y
@param $width
@param $height

@return bool
Returns true iff the cropping does not exceed the image borders .