You are here

private function BlazyFormatter::cropStyles in Blazy 8.2

Returns available image styles with crop in the name.

1 call to BlazyFormatter::cropStyles()
BlazyFormatter::isCrop in src/BlazyFormatter.php
Checks if an image style contains crop effect.

File

src/BlazyFormatter.php, line 176

Class

BlazyFormatter
Provides common field formatter-related methods: Blazy, Slick.

Namespace

Drupal\blazy

Code

private function cropStyles() {
  if (!isset($this->cropStyles)) {
    $this->cropStyles = [];
    foreach ($this
      ->entityLoadMultiple('image_style') as $style) {
      foreach ($style
        ->getEffects() as $effect) {
        if (strpos($effect
          ->getPluginId(), 'crop') !== FALSE) {
          $this->cropStyles[$style
            ->getName()] = $style;
          break;
        }
      }
    }
  }
  return $this->cropStyles;
}