You are here

public function ImageStylesProvider::entityIsImage in Consumer Image Styles 4.x

Same name and namespace in other branches
  1. 8.3 src/ImageStylesProvider.php \Drupal\consumer_image_styles\ImageStylesProvider::entityIsImage()

{inheritdoc}

Overrides ImageStylesProviderInterface::entityIsImage

File

src/ImageStylesProvider.php, line 89

Class

ImageStylesProvider
Class ImageStylesProvider.

Namespace

Drupal\consumer_image_styles

Code

public function entityIsImage(EntityInterface $entity) {
  if (!$entity instanceof File) {
    return FALSE;
  }
  return in_array(mb_strtolower(pathinfo($entity
    ->getFileUri(), PATHINFO_EXTENSION)), $this->imageFactory
    ->getSupportedExtensions());
}