I gladly managed it to write my own module which adds an gaussian blur filter effect option to the drupal standard dropdown:
function image_blur_image_effect_info() {
return array(
'image_blur' => array(
'label' => t('Gaussian Blur'),
'help' => t('Gaussian blur the image by a (currently) fixed amount.'),
'effect callback' => 'image_blur_gaussian_blur'
)
);
}
This adds “Gaussian Blur” to the dropdown and the function even works when applied to the image.
function image_blur_gaussian_blur(stdClass $image) {
boxBlurImage($image->resource, 10, 2);
return true;
}
But, when I select the effect and click on apply, I’d love to have the possibility to let the user type in the radius of the blur, just like one is capable of when using drupal’s “Resize”, “Scale” instead of just applying the function with fix values and so on:
function image_blur_gaussian_blur(stdClass $image, **$radius**) {
boxBlurImage($image->resource, **$radius**, 2);
return true;
}
I cant figure it out by myself from the other function’s codes in image.inc /:
You need to add a
form callbackproperty to your info array, which is:For example:
You’ll then have access to
$data['radius']in the effect callback function, which will contain the values submitted through the admin form.Make sure you clear the caches once you’ve made the code changes, otherwise the new hook data won’t be picked up.