public static function getCropPoint($resizeSize, $cropSize, $position): Point
    {
        // Get the offsets, left and top, now as an int, representing the % offset
        list($leftOffset, $topOffset) = explode(' ', $position);

        // Get position that crop should center around
        $leftPos = floor($resizeSize->getWidth() * ($leftOffset / 100)) - floor($cropSize->getWidth() / 2);
        $topPos = floor($resizeSize->getHeight() * ($topOffset / 100)) - floor($cropSize->getHeight() / 2);

        // Make sure the point is within the boundaries and return the point
        try {
            $point = new Point(
                min(max($leftPos, 0), $resizeSize->getWidth() - $cropSize->getWidth()),
                min(max($topPos, 0), $resizeSize->getHeight() - $cropSize->getHeight())
            );
        } catch (InvalidArgumentException $e) {
            \Craft::error($e->getMessage(), __METHOD__);
            throw new ImagerException($e->getMessage(), $e->getCode(), $e);
        }

        return $point;
    }
public static function getCropPoint($resizeSize, $cropSize, $position): Point
    {
        // Get the offsets, left and top, now as an int, representing the % offset
        list($leftOffset, $topOffset) = explode(' ', $position);

        // Get position that crop should center around
        $leftPos = floor($resizeSize->getWidth() * ($leftOffset / 100)) - floor($cropSize->getWidth() / 2);
        $topPos = floor($resizeSize->getHeight() * ($topOffset / 100)) - floor($cropSize->getHeight() / 2);

        // Make sure the point is within the boundaries and return the point
        try {
            $point = new Point(
                min(max($leftPos, 0), $resizeSize->getWidth() - $cropSize->getWidth()),
                min(max($topPos, 0), $resizeSize->getHeight() - $cropSize->getHeight())
            );
        } catch (InvalidArgumentException $e) {
            \Craft::error($e->getMessage(), __METHOD__);
            throw new ImagerException($e->getMessage(), $e->getCode(), $e);
        }

        return $point;
    }
public static function getCropPoint ( $ resizeSize , $ cropSize , $ position ) : Point { // Get the offsets, left and top, now as an int, representing the % offset list ( $ leftOffset , $ topOffset ) = explode ( ' ' , $ position ) ; // Get position that crop should center around $ leftPos = floor ( $ resizeSize -> getWidth ( ) * ( $ leftOffset / 100 ) ) - floor ( $ cropSize -> getWidth ( ) / 2 ) ; $ topPos = floor ( $ resizeSize -> getHeight ( ) * ( $ topOffset / 100 ) ) - floor ( $ cropSize -> getHeight ( ) / 2 ) ; // Make sure the point is within the boundaries and return the point try { $ point = new Point ( min ( max ( $ leftPos , 0 ) , $ resizeSize -> getWidth ( ) - $ cropSize -> getWidth ( ) ) , min ( max ( $ topPos , 0 ) , $ resizeSize -> getHeight ( ) - $ cropSize -> getHeight ( ) ) ) ; } catch ( InvalidArgumentException $ e ) { \ Craft :: error ( $ e -> getMessage ( ) , __METHOD__ ) ; throw new ImagerException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } return $ point ; }
Gets crop point

@param \Imagine\Image\Box $resizeSize
@param \Imagine\Image\Box $cropSize
@param string $position

@return \Imagine\Image\Point
@throws ImagerException
Gets crop point