function ResizeImageEffect::transformDimensions

Same name in other branches
  1. 9 core/modules/image/src/Plugin/ImageEffect/ResizeImageEffect.php \Drupal\image\Plugin\ImageEffect\ResizeImageEffect::transformDimensions()
  2. 8.9.x core/modules/image/src/Plugin/ImageEffect/ResizeImageEffect.php \Drupal\image\Plugin\ImageEffect\ResizeImageEffect::transformDimensions()
  3. 11.x core/modules/image/src/Plugin/ImageEffect/ResizeImageEffect.php \Drupal\image\Plugin\ImageEffect\ResizeImageEffect::transformDimensions()

Overrides ImageEffectBase::transformDimensions

1 method overrides ResizeImageEffect::transformDimensions()
ScaleImageEffect::transformDimensions in core/modules/image/src/Plugin/ImageEffect/ScaleImageEffect.php
Determines the dimensions of the styled image.

File

core/modules/image/src/Plugin/ImageEffect/ResizeImageEffect.php, line 35

Class

ResizeImageEffect
Resizes an image resource.

Namespace

Drupal\image\Plugin\ImageEffect

Code

public function transformDimensions(array &$dimensions, $uri) {
    // The new image will have the exact dimensions defined for the effect.
    $dimensions['width'] = $this->configuration['width'];
    $dimensions['height'] = $this->configuration['height'];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.