BlurCommand.php 520 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace Intervention\Image\Gd\Commands;
  3. class BlurCommand extends \Intervention\Image\Commands\AbstractCommand
  4. {
  5. /**
  6. * Applies blur effect on image
  7. *
  8. * @param \Intervention\Image\Image $image
  9. * @return boolean
  10. */
  11. public function execute($image)
  12. {
  13. $amount = $this->argument(0)->between(0, 100)->value(1);
  14. for ($i=0; $i < intval($amount); $i++) {
  15. imagefilter($image->getCore(), IMG_FILTER_GAUSSIAN_BLUR);
  16. }
  17. return true;
  18. }
  19. }