RotateCommand.php 631 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace Intervention\Image\Imagick\Commands;
  3. use Intervention\Image\Imagick\Color;
  4. class RotateCommand extends \Intervention\Image\Commands\AbstractCommand
  5. {
  6. /**
  7. * Rotates image counter clockwise
  8. *
  9. * @param \Intervention\Image\Image $image
  10. * @return boolean
  11. */
  12. public function execute($image)
  13. {
  14. $angle = $this->argument(0)->type('numeric')->required()->value();
  15. $color = $this->argument(1)->value();
  16. $color = new Color($color);
  17. // rotate image
  18. $image->getCore()->rotateImage($color->getPixel(), ($angle * -1));
  19. return true;
  20. }
  21. }