Problem/Motivation

We set up an image style with a strong gaussian blur. When we set this up two years ago, we left the Sigma field ampty, as the help text advises that the default values will be used then. A couple of days ago, the effect stopped working and I can see this message in the log:

The image toolkit 'gd' failed processing 'gaussian_blur' for image 'public://2025-06/example.jpg'. Reported error: InvalidArgumentException - NULL passed to 'sigma', expected float

Partial stacktrace:

/core/lib/Drupal/Core/ImageToolkit/ImageToolkitBase.php in Drupal\Core\ImageToolkit\ImageToolkitBase::apply at line 136
/core/lib/Drupal/Core/Image/Image.php in Drupal\Core\Image\Image::apply at line 142
/modules/contrib/image_effects/src/Plugin/ImageEffect/GaussianBlurImageEffect.php in Drupal\image_effects\Plugin\ImageEffect\GaussianBlurImageEffect::applyEffect at line 106
...

The error actually occurs in `GaussianBlurTrait::validateArguments`, which calls `ArgumentsTypeValidator::validate`.

Steps to reproduce

1. Set up an image style
2. Add the effect "Gaussian Blur"
3. Configure the effect with a radius, e.g. "10" px, but leave the sigma field empty
4. Use the image style on an uploaded image

Expected result: The image is blurred. Actual: It is not blurred, because of above mentioned error.

Proposed resolution

Something is wrong in `ArgumentsTypeValidator::validate`. It gets the type of the sigma parameter as "float". Then it checks if this type starts with a "?", to see if it is nullable or not.

The argument definition is coming from `GaussianBlurTrait::arguments`, though. Shouldn't this rather use the "required" flag instead to check if the value should be nullable?

Remaining tasks

...

User interface changes

...

API changes

None

Data model changes

None

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ammaletu created an issue. See original summary.

mondrake made their first commit to this issue’s fork.

mondrake’s picture

Status: Active » Needs review

Is this sufficient? IDNT we need a test here.

mondrake’s picture

Version: 4.0.0 » 4.1.x-dev
ammaletu’s picture

I added a very simple test case, by copying the existing test case. I had to comment out the imagemagick modules, but for the GD module, the test failed without the change and succeeded with the change.

mondrake’s picture

  • mondrake committed 63b9c37c on 4.1.x
    Issue #3528199 by mondrake, ammaletu: The image toolkit 'gd' failed...
mondrake’s picture

Status: Needs review » Fixed

Fixed, thank you

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.