You are here

function filtersie_sharpenUSM_effect in FiltersIE 7

Image effect callback; Sharpen an image resource using USM.

Parameters

type $image: An image object returned by image_load().

type $data: An array of attributes to use when performing the sharpen effect with the following items:

  • "sharpenlevel": An integer representing the desired sharpen level.

Return value

type TRUE on success. FALSE on failure to sharpen image.

See also

filtersie_sharpen()

1 call to filtersie_sharpenUSM_effect()
FilterIEImageEffectsUnitTest::testfiltersie_UnsharpMaskEffect in ./filtersie.test
Test the filtersie_sharpenUSM_effect() function.
1 string reference to 'filtersie_sharpenUSM_effect'
filtersie_image_effect_info in ./filtersie.module
Implements hook_image_effect_info.

File

./filtersie.module, line 136
Filters Image Effect (filtersie)

Code

function filtersie_sharpenUSM_effect(&$image, $data) {
  $data = $data + array(
    'sigma' => NULL,
  );
  if (!filtersie_sharpenUSM($image, $data['amount'], $data['radius'], $data['threshold'], $data['sigma'])) {
    watchdog('filtersie', 'Filters Image Effects sharpen USM technique failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array(
      '%toolkit' => $image->toolkit,
      '%path' => $image->source,
      '%mimetype' => $image->info['mime_type'],
      '%dimensions' => $image->info['height'] . 'x' . $image->info['height'],
    ), WATCHDOG_ERROR);
    return FALSE;
  }
  return TRUE;
}