You are here

public function BlazyManager::isCrop in Blazy 8

Checks if an image style contains crop effect.

2 calls to BlazyManager::isCrop()
BlazyManager::buildDataBlazy in src/BlazyManager.php
Builds breakpoints suitable for top-level [data-blazy] wrapper attributes.
BlazyManager::setDimensionsOnce in src/BlazyManager.php
Sets dimensions once to reduce method calls, if image style contains crop.

File

src/BlazyManager.php, line 35

Class

BlazyManager
Implements a public facing blazy manager.

Namespace

Drupal\blazy

Code

public function isCrop($style = NULL) {
  foreach ($style
    ->getEffects() as $effect) {
    if (strpos($effect
      ->getPluginId(), 'crop') !== FALSE) {
      return TRUE;
    }
  }
  return FALSE;
}