src/Manipulators/Crop.php
public function getCoordinates(Image $image)
    {
        $coordinates = explode(',', $this->crop);

        if (count($coordinates) !== 4 or
            (!is_numeric($coordinates[0])) or
            (!is_numeric($coordinates[1])) or
            (!is_numeric($coordinates[2])) or
            (!is_numeric($coordinates[3])) or
            ($coordinates[0] <= 0) or
            ($coordinates[1] <= 0) or
            ($coordinates[2] < 0) or
            ($coordinates[3] < 0) or
            ($coordinates[2] >= $image->width()) or
            ($coordinates[3] >= $image->height())) {
            return;
        }

        return [
            (int) $coordinates[0],
            (int) $coordinates[1],
            (int) $coordinates[2],
            (int) $coordinates[3],
        ];
    }
public function getCoordinates(Image $image)
    {
        $coordinates = explode(',', $this->crop);

        if (count($coordinates) !== 4 or
            (!is_numeric($coordinates[0])) or
            (!is_numeric($coordinates[1])) or
            (!is_numeric($coordinates[2])) or
            (!is_numeric($coordinates[3])) or
            ($coordinates[0] <= 0) or
            ($coordinates[1] <= 0) or
            ($coordinates[2] < 0) or
            ($coordinates[3] < 0) or
            ($coordinates[2] >= $image->width()) or
            ($coordinates[3] >= $image->height())) {
            return;
        }

        return [
            (int) $coordinates[0],
            (int) $coordinates[1],
            (int) $coordinates[2],
            (int) $coordinates[3],
        ];
    }
public function getCoordinates ( Image $ image ) { $ coordinates = explode ( ',' , $ this -> crop ) ; if ( count ( $ coordinates ) !== 4 or ( ! is_numeric ( $ coordinates [ 0 ] ) ) or ( ! is_numeric ( $ coordinates [ 1 ] ) ) or ( ! is_numeric ( $ coordinates [ 2 ] ) ) or ( ! is_numeric ( $ coordinates [ 3 ] ) ) or ( $ coordinates [ 0 ] <= 0 ) or ( $ coordinates [ 1 ] <= 0 ) or ( $ coordinates [ 2 ] < 0 ) or ( $ coordinates [ 3 ] < 0 ) or ( $ coordinates [ 2 ] >= $ image -> width ( ) ) or ( $ coordinates [ 3 ] >= $ image -> height ( ) ) ) { return ; } return [ ( int ) $ coordinates [ 0 ] , ( int ) $ coordinates [ 1 ] , ( int ) $ coordinates [ 2 ] , ( int ) $ coordinates [ 3 ] , ] ; }
Resolve coordinates.
@param  Image $image The source image.
@return int[] The resolved coordinates.
Resolve coordinates .