You are here

function image_effects_requirements in Image Effects 8.3

Same name and namespace in other branches
  1. 8 image_effects.install \image_effects_requirements()
  2. 8.2 image_effects.install \image_effects_requirements()

Implements hook_requirements().

File

./image_effects.install, line 11
Install, update and uninstall functions for the image_effects module.

Code

function image_effects_requirements($phase) {
  $requirements = [];

  // Check PHP GD2 FreeType support.
  if (function_exists('gd_info')) {
    $info = gd_info();
    if (!function_exists('imagettftext') || !isset($info["FreeType Support"])) {

      // No FreeType support, raise warning.
      $requirements['image_effects_gd_freetype'] = [
        'title' => t('GD library FreeType support'),
        'value' => t('Not installed'),
        'severity' => REQUIREMENT_WARNING,
        'description' => t('The GD Library for PHP is enabled, but was compiled without FreeType support. Image effects using fonts will not be available with the GD image toolkit.'),
      ];
    }
  }
  return $requirements;
}