Posterize throwing error when applied to a image style

Created on 21 February 2024, 9 months ago
Updated 22 February 2024, 9 months ago

Problem/Motivation

Hey everyone, I'm using Imagick on my site and we saw that some images had a higher size with the Imagick module enabled, I saw that Imagick has an effect called "Posterize" that helps with it by reducing the number of color channels on the image, but when I try to use it it throws an error "call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "image_effect_integer_validate" not found or invalid function name in call_user_func_array()"

Steps to reproduce

- Go to an Image Style of your site
- Look for "Posterize" and add it
- It'll go to a color channel page, just click to add effect

Proposed resolution

I saw that on PosterizeImageEffect.php::buildConfiguration() the array that mounts it has a "'#element_validate' => ['image_effect_integer_validate']" and this function does not exist.
I'll create a patch and upload here removing it so we can use it on our site but I'm not sure if that is the best solution

Remaining tasks

Try to understand why this element_validate was added to be sure that removing it will not have any side effects.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇧🇷Brazil Lucas Fernandes

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

Comments & Activities

Production build 0.71.5 2024