Blame view

backend/components/croppers/AbstractCrop.php 363 Bytes
01ebf78c   Administrator   Initial commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  <?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);
      }
  }