Cheetah
FlipCommand.php
Go to the documentation of this file.
1 <?php
2 
4 
6 {
13  public function execute($image)
14  {
15  $mode = $this->argument(0)->value('h');
16 
17  $size = $image->getSize();
18  $dst = clone $size;
19 
20  switch (strtolower($mode)) {
21  case 2:
22  case 'v':
23  case 'vert':
24  case 'vertical':
25  $size->pivot->y = $size->height - 1;
26  $size->height = $size->height * (-1);
27  break;
28 
29  default:
30  $size->pivot->x = $size->width - 1;
31  $size->width = $size->width * (-1);
32  break;
33  }
34 
35  return $this->modify($image, 0, 0, $size->pivot->x, $size->pivot->y, $dst->width, $dst->height, $size->width, $size->height);
36  }
37 }
Intervention\Image\Gd\Commands\ResizeCommand\modify
modify($image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h)
Definition: ResizeCommand.php:42
Intervention\Image\Gd\Commands
Definition: BackupCommand.php:3
php
Intervention\Image\Gd\Commands\FlipCommand
Definition: FlipCommand.php:6
Intervention\Image\Commands\AbstractCommand\argument
argument($key)
Definition: AbstractCommand.php:45
Intervention\Image\Gd\Commands\FlipCommand\execute
execute($image)
Definition: FlipCommand.php:13
Intervention\Image\Gd\Commands\ResizeCommand
Definition: ResizeCommand.php:6