- Issue created by @ammaletu
- First commit to issue fork.
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`.
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.
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?
...
...
None
None
Active
4.0
Code