The imagemagick color sampling code contains calls to deprecated imagemagick methods that have been removed completely since January 2018. #2936616: Remove usage of deprecated methods
This might lead to a fatal error when editing the background image configuration with a recent version of the imagemagick module installed and configured as the default image toolkit.

Error: Call to undefined method Drupal\imagemagick\ImagemagickExecArguments::addArgument() in Drupal\background_image\BackgroundImageManager->colorSampleImagemagickImage() (line 293)

Attached patch replaces the calls to addArgument() with the new add() method and also fixes the color sampling itself.

Comments

basvredeling created an issue. See original summary.

basvredeling’s picture

Status: Active » Needs review
basvredeling’s picture

Title: Deprecated imagemagick methods » Fix imagemagick color sampling
Issue summary: View changes
StatusFileSize
new1.06 KB
markhalliwell’s picture

Title: Fix imagemagick color sampling » Handle ImagemagickExecArguments deprecations
Assigned: Unassigned » markhalliwell
Status: Needs review » Needs work

replaces the calls to addArgument() with the new add() method

It should really handle both cases.

and also fixes the color sampling itself

I'm not sure why this change has been made. There doesn't appear to be any real "fix"; just a different output format and usage of preg_match of all the text output (which is likely to be more unstable IMO). If you can explain what the actual issue is (why it needs to be changed), please create another issue.

markhalliwell’s picture

Assigned: markhalliwell » Unassigned
Status: Needs work » Fixed
StatusFileSize
new2.48 KB

  • markcarver committed 0f9a2a2 on 8.x-1.x
    Issue #3106828 by markcarver, basvredeling: Handle...

Status: Fixed » Closed (fixed)

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