You are here

public function ImageNormalizerValue::rasterizeValue in Consumer Image Styles 8.2

Same name and namespace in other branches
  1. 8 src/Normalizer/Value/ImageNormalizerValue.php \Drupal\consumer_image_styles\Normalizer\Value\ImageNormalizerValue::rasterizeValue()

Get the rasterized value.

Return value

mixed The value.

Overrides ValueExtractorInterface::rasterizeValue

File

src/Normalizer/Value/ImageNormalizerValue.php, line 38

Class

ImageNormalizerValue

Namespace

Drupal\consumer_image_styles\Normalizer\Value

Code

public function rasterizeValue() {
  $rasterized = $this->subject
    ->rasterizeValue();
  $derivatives = $this->variants
    ->rasterizeValue();
  if (empty($derivatives)) {
    return $rasterized;
  }
  $rasterized['meta'] = empty($rasterized['meta']) ? [] : $rasterized['meta'];
  $rasterized['meta']['derivatives'] = $derivatives;
  return $rasterized;
}