You are here

function image_gd_blur in ImageCache Actions 8

Same name and namespace in other branches
  1. 7 canvasactions/canvasactions.inc \image_gd_blur()

GD toolkit specific implementation of the blur effect.

Parameters

stdClass $image:

int $intensity: The number of times to apply the blur filter.

Return value

boolean True on success, false otherwise.

File

canvasactions/canvasactions.inc, line 1156

Code

function image_gd_blur(stdClass $image, $intensity) {
  $intensity = (int) $intensity;
  $result = TRUE;
  $i = 0;
  while ($result && $i++ < $intensity) {
    $result = imagefilter($image->resource, IMG_FILTER_GAUSSIAN_BLUR);
  }
  return $result;
}