function GDToolkit::supportedTypes

Same name and namespace in other branches
  1. 11.x core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php \Drupal\system\Plugin\ImageToolkit\GDToolkit::supportedTypes()
  2. 10 core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php \Drupal\system\Plugin\ImageToolkit\GDToolkit::supportedTypes()
  3. 9 core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php \Drupal\system\Plugin\ImageToolkit\GDToolkit::supportedTypes()
  4. 8.9.x core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php \Drupal\system\Plugin\ImageToolkit\GDToolkit::supportedTypes()

Returns a list of image types supported by the toolkit.

Return value

array An array of available image types. An image type is represented by a PHP IMAGETYPE_* constant (e.g. IMAGETYPE_JPEG, IMAGETYPE_PNG, etc.).

4 calls to GDToolkit::supportedTypes()
GDToolkit::extensionToImageType in core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
Returns the IMAGETYPE_xxx constant for the given extension.
GDToolkit::getSupportedExtensions in core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
GDToolkit::parseFile in core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
GDToolkit::setType in core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
Sets the PHP type of the image.

File

core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php, line 558

Class

GDToolkit
Defines the GD2 toolkit for image manipulation within Drupal.

Namespace

Drupal\system\Plugin\ImageToolkit

Code

protected static function supportedTypes() {
  $types = [
    IMAGETYPE_PNG,
    IMAGETYPE_JPEG,
    IMAGETYPE_GIF,
    IMAGETYPE_WEBP,
  ];
  if (static::checkAvifSupport()) {
    $types[] = IMAGETYPE_AVIF;
  }
  return $types;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.