function GDToolkit::supportedTypes

Same name and namespace in other branches
  1. 8.9.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. 11.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
Returns a list of image file extensions supported by the toolkit.
GDToolkit::parseFile in core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
Determines if a file contains a valid image.
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 471

Class

GDToolkit
Defines the GD2 toolkit for image manipulation within Drupal.

Namespace

Drupal\system\Plugin\ImageToolkit

Code

protected static function supportedTypes() {
    return [
        IMAGETYPE_PNG,
        IMAGETYPE_JPEG,
        IMAGETYPE_GIF,
        IMAGETYPE_WEBP,
    ];
}

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