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
Issue fork image_effects-3528199
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
Comment #4
mondrakeIs this sufficient? IDNT we need a test here.
Comment #5
mondrakeComment #6
ammaletu commentedI 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.
Comment #7
mondrakeComment #9
mondrakeFixed, thank you