function ImageFactory::getSupportedExtensions

Same name in other branches
  1. 9 core/lib/Drupal/Core/Image/ImageFactory.php \Drupal\Core\Image\ImageFactory::getSupportedExtensions()
  2. 10 core/lib/Drupal/Core/Image/ImageFactory.php \Drupal\Core\Image\ImageFactory::getSupportedExtensions()
  3. 11.x core/lib/Drupal/Core/Image/ImageFactory.php \Drupal\Core\Image\ImageFactory::getSupportedExtensions()

Returns the image file extensions supported by the toolkit.

Parameters

string|null $toolkit_id: (optional) The ID of the image toolkit to use for checking, or NULL to use the current toolkit.

Return value

array An array of supported image file extensions (e.g. png/jpeg/gif).

See also

\Drupal\Core\ImageToolkit\ImageToolkitInterface::getSupportedExtensions()

File

core/lib/Drupal/Core/Image/ImageFactory.php, line 100

Class

ImageFactory
Provides a factory for image objects.

Namespace

Drupal\Core\Image

Code

public function getSupportedExtensions($toolkit_id = NULL) {
    $toolkit_id = $toolkit_id ?: $this->toolkitId;
    $definition = $this->toolkitManager
        ->getDefinition($toolkit_id);
    return call_user_func($definition['class'] . '::getSupportedExtensions');
}

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