/libraries/joomla/image/filters/sketchy.php

https://bitbucket.org/kraymitchell/fcd · PHP · 43 lines · 14 code · 3 blank · 26 comment · 1 complexity · c7356c6586eb773dbd4eae6f61717d07 MD5 · raw file

  1. <?php
  2. /**
  3. * @package Joomla.Platform
  4. * @subpackage Image
  5. *
  6. * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE
  8. */
  9. defined('JPATH_PLATFORM') or die;
  10. /**
  11. * Image Filter class to make an image appear "sketchy".
  12. *
  13. * @package Joomla.Platform
  14. * @subpackage Image
  15. * @since 11.3
  16. */
  17. class JImageFilterSketchy extends JImageFilter
  18. {
  19. /**
  20. * Method to apply a filter to an image resource.
  21. *
  22. * @param array $options An array of options for the filter.
  23. *
  24. * @return void
  25. *
  26. * @since 11.3
  27. * @throws RuntimeException
  28. */
  29. public function execute(array $options = array())
  30. {
  31. // Verify that image filter support for PHP is available.
  32. if (!function_exists('imagefilter'))
  33. {
  34. JLog::add('The imagefilter function for PHP is not available.', JLog::ERROR);
  35. throw new RuntimeException('The imagefilter function for PHP is not available.');
  36. }
  37. // Perform the sketchy filter.
  38. imagefilter($this->handle, IMG_FILTER_MEAN_REMOVAL);
  39. }
  40. }