You are here

public function ImageStyle::supportsUri in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/image/src/Entity/ImageStyle.php \Drupal\image\Entity\ImageStyle::supportsUri()

Determines if this style can be applied to a given image.

Parameters

string $uri: The URI of the image.

Return value

bool TRUE if the image is supported, FALSE otherwise.

Overrides ImageStyleInterface::supportsUri

File

core/modules/image/src/Entity/ImageStyle.php, line 376

Class

ImageStyle
Defines an image style configuration entity.

Namespace

Drupal\image\Entity

Code

public function supportsUri($uri) {

  // Only support the URI if its extension is supported by the current image
  // toolkit.
  return in_array(mb_strtolower(pathinfo($uri, PATHINFO_EXTENSION)), $this
    ->getImageFactory()
    ->getSupportedExtensions());
}