AbstractCrop.php 363 Bytes
<?php

namespace backend\components\croppers;


use backend\components\ConstantTrait;
use Imagine\Image\Box;
use Imagine\Image\Point;

abstract class AbstractCrop
{
    use ConstantTrait;

    public function crop($image, $path)
    {
        $image->crop(new Point(static::X, static::Y), new Box(static::WIDTH, static::HEIGHT))
            ->save($path);
    }
}