The image module has an unstated dependency on having an image toolkit (e.g. GD, Imagick, etc).

Currently, hook_requirements for image will allow the module to be enabled, even if there is no toolkit, and
this comment indicates that's the case

In some PHP installs (e.g. Brew on the mac), GD is compiled directly into PHP and cannot be trivially removed. In other distributions (e.g. Ubuntu/Precise), the GD extension is enabled via config in a PHP ini file (extension=gd.so) so can be trivially disabled. In other words, users may be running a standard distribution of PHP 5.4 without necessarily having GD (or any other toolkit) installed.

If I force the image toolkit to be unavailable, reproducing the case described in #1079116: Inaccurate text: Images must be smaller than !max pixels. causes a fatal error when it tries to resize the image.

We should either update hook_requirements() to require the toolkit, or refactor Image module to be more resilient to a missing toolkit. We should also review the documentation at https://drupal.org/requirements/php to ensure the Image library documentation matches any changes we make.

Comments

fearlsgroove’s picture

fearlsgroove’s picture

Title: Image toolkit is required, or certain image actions must account for no toolkit » Image toolkit is required so update hook_requirements to indicate so
fearlsgroove’s picture

Issue summary: View changes
manarth’s picture

Title: Image toolkit is required so update hook_requirements to indicate so » Add a dependency to Image module because it requires an image toolkit
Issue summary: View changes
manarth’s picture

Issue summary: View changes
manarth’s picture

Status: Active » Closed (works as designed)

The GD extension is *required* in Drupal 8 (and Drupal 7), and this dependency is enforced in system_requirements(), so we don't need further checks in Image module. I've updated the documentation in https://drupal.org/requirements/php to note this requirement.