The image toolkit 'gd' failed processing 'gaussian_blur': InvalidArgumentException - NULL passed to 'sigma', expected float

Created on 3 June 2025, 4 days ago

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

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇩🇪Germany ammaletu Bonn, Germany

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024