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
Comment #1
fearlsgroove commentedComment #2
fearlsgroove commentedComment #3
fearlsgroove commentedComment #4
manarth commentedComment #5
manarth commentedComment #6
manarth commentedThe 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.