\Drupal\imagick\Plugin\ImageToolkit\ImagickToolkit::isValid() should be more restrictive

Created on 28 February 2022, over 2 years ago
Updated 15 February 2024, 9 months ago

Problem/Motivation

\Drupal\imagick\Plugin\ImageToolkit\ImagickToolkit::isValid() currently returns TRUE as soon as there is a valid path to the file. The \Drupal\Core\ImageToolkit\ImageToolkitInterface::isValid() interface says that the returned value should be "TRUE if the image toolkit is currently handling a valid image, FALSE otherwise".

This condition might be used by Core or contrib to test if an image is valid or not (see \Drupal\Core\Image\Image::isValid()) so we have to be more restrictive on our implementation.

Proposed resolution

Follow Core and use $this->resource like it's done in \Drupal\system\Plugin\ImageToolkit\GDToolkit::isValid()

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇫🇷France duaelfr Montpellier, France

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024