public ImageStyleInterface::transformDimensions(array &$dimensions, $uri)
Determines the dimensions of this image style.
Stores the dimensions of this image style into $dimensions associative array. Implementations have to provide at least values to next keys:
- width: Integer with the derivative image width.
- height: Integer with the derivative image height.
Parameters
array $dimensions: Associative array passed by reference. Implementations have to store the resulting width and height, in pixels.
string $uri: Original image file URI. It is passed in to allow effects to optionally use this information to retrieve additional image metadata to determine dimensions of the styled image. ImageStyleInterface::transformDimensions key objective is to calculate styled image dimensions without performing actual image operations, so be aware that performing IO on the URI may lead to decrease in performance.
See also
ImageEffectInterface::transformDimensions
File
- core/modules/image/src/ImageStyleInterface.php, line 143
Class
- ImageStyleInterface
- Provides an interface defining an image style entity.
Namespace
Drupal\image
Code
public function transformDimensions(array &$dimensions, $uri);
Please login to continue.