You are here

public function ImageFactory::getSupportedExtensions in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 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 105
Contains \Drupal\Core\Image\ImageFactory.

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');
}