Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ImageStyleInterface.php

function ImageStyleInterface::transformDimensions

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

1 method overrides ImageStyleInterface::transformDimensions()
ImageStyle::transformDimensions in core/modules/image/src/Entity/ImageStyle.php
Determines the dimensions of this image style.

File

core/modules/image/src/ImageStyleInterface.php, line 128

Class

ImageStyleInterface
Provides an interface defining an image style entity.

Namespace

Drupal\image

Code

public function transformDimensions(array &$dimensions, $uri);

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal