You are here

public static function Blazy::transformDimensions in Blazy 7

6 calls to Blazy::transformDimensions()
Blazy::buildBreakpointAttributes in src/Blazy.php
Provides re-usable breakpoint data-attributes for IMG or DIV element.
Blazy::imageUrl in src/Blazy.php
Provides image url based on the given settings.
BlazyBreakpoint::attributes in src/BlazyBreakpoint.php
Provides re-usable breakpoint data-attributes for IMG or DIV element.
BlazyBreakpoint::buildDataBlazy in src/BlazyBreakpoint.php
Builds breakpoints suitable for top-level [data-blazy] wrapper attributes.
BlazyFormatter::setImageDimensions in src/BlazyFormatter.php
Sets dimensions once to reduce method calls, if image style contains crop.

... See full list

File

src/Blazy.php, line 92

Class

Blazy
Implements BlazyInterface.

Namespace

Drupal\blazy

Code

public static function transformDimensions($image_style, $item = NULL) {
  $dimensions['width'] = $item && isset($item->width) ? $item->width : NULL;
  $dimensions['height'] = $item && isset($item->height) ? $item->height : NULL;
  image_style_transform_dimensions($image_style, $dimensions);
  return $dimensions;
}