You are here

public static function Blazy::imageDimensions in Blazy 7

4 calls to Blazy::imageDimensions()
Blazy::urlAndDimensions in src/Blazy.php
BlazyBreakpoint::buildDataBlazy in src/BlazyBreakpoint.php
Builds breakpoints suitable for top-level [data-blazy] wrapper attributes.
BlazyFormatter::extractFirstItem in src/BlazyFormatter.php
BlazyManagerBase::buildDataBlazy in src/BlazyManagerBase.php
To be deprecated method.

File

src/Blazy.php, line 53

Class

Blazy
Implements BlazyInterface.

Namespace

Drupal\blazy

Code

public static function imageDimensions(array &$settings, $item = NULL, $initial = FALSE) {
  $width = $initial ? '_width' : 'width';
  $height = $initial ? '_height' : 'height';
  if (empty($settings[$width])) {
    $settings[$width] = $item && isset($item->width) ? $item->width : NULL;
    $settings[$height] = $item && isset($item->height) ? $item->height : NULL;
  }
}