Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8422863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:34:28+00:00 2026-06-10T03:34:28+00:00

I gladly managed it to write my own module which adds an gaussian blur

  • 0

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 /:

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T03:34:30+00:00Added an answer on June 10, 2026 at 3:34 am

    You need to add a form callback property to your info array, which is:

    The name of a function that will return a $form array providing a configuration form for this image effect.

    For example:

    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',
          'form callback' => 'image_blur_form'
        )
      ); 
    }
    
    function image_blur_form($data) {
      $form['radius'] = array(
        '#type' => 'textfield',
        '#title' => t('Radius'),
        '#required' => TRUE,
        '#default_value' => isset($data['radius']) ? $data['radius'] : '', 
        '#size' => 10,
        '#element_validate' => array('image_effect_integer_validate'), 
      );
    
      // Add any other elements here.
    
      return $form;
    }
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any free tools for scripting MSSQL table data? I'll gladly write one,
I've managed to do recognize characters from image. For this reason: I save all
I am starting a game project which will allow characters to hide in dark
Have a linking (or ref) table which has a dual primary key. Need to
Which would be the best way to do it? Right now, I convert my
I run Jetty6 yet gladly place Apache in the front if needs be. I
I'm writing this question in the spirit of answering your own questions, since I
i installed the latest stable bzr version and gladly discover the external merge feature.
i have created a Makefile which i would change so, that it will generate
Hey i am trying to compare the date on which the user opens the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.