Cheetah
OrientateCommand.php
Go to the documentation of this file.
1 <?php
2 
4 
6 {
13  public function execute($image)
14  {
15  switch ($image->exif('Orientation')) {
16 
17  case 2:
18  $image->flip();
19  break;
20 
21  case 3:
22  $image->rotate(180);
23  break;
24 
25  case 4:
26  $image->rotate(180)->flip();
27  break;
28 
29  case 5:
30  $image->rotate(270)->flip();
31  break;
32 
33  case 6:
34  $image->rotate(270);
35  break;
36 
37  case 7:
38  $image->rotate(90)->flip();
39  break;
40 
41  case 8:
42  $image->rotate(90);
43  break;
44  }
45 
46  return true;
47  }
48 }
Intervention\Image\Commands
Definition: AbstractCommand.php:3
php
Intervention\Image\Commands\OrientateCommand\execute
execute($image)
Definition: OrientateCommand.php:13
Intervention\Image\Commands\OrientateCommand
Definition: OrientateCommand.php:6
Intervention\Image\Commands\AbstractCommand
Definition: AbstractCommand.php:6