function responsive_image_get_image_dimensions

Same name and namespace in other branches
  1. 10 core/modules/responsive_image/responsive_image.module \responsive_image_get_image_dimensions()
  2. 9 core/modules/responsive_image/responsive_image.module \responsive_image_get_image_dimensions()
  3. 8.9.x core/modules/responsive_image/responsive_image.module \responsive_image_get_image_dimensions()
  4. main core/modules/responsive_image/responsive_image.module \responsive_image_get_image_dimensions()

Determines the dimensions of an image.

Parameters

string $image_style_name: The name of the style to be used to alter the original image.

array $dimensions: An associative array containing:

  • width: The width of the source image (if known).
  • height: The height of the source image (if known).

string $uri: The URI of the image file.

Return value

array Dimensions to be modified - an array with components width and height, in pixels.

Deprecated

in drupal:11.3.0 and is removed from drupal:12.0.0. Use \Drupal\responsive_image\ResponsiveImageBuilder::getImageDimensions() instead.

See also

https://www.drupal.org/node/3548329

File

core/modules/responsive_image/responsive_image.module, line 228

Code

function responsive_image_get_image_dimensions($image_style_name, array $dimensions, $uri) {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.3.0 and is removed from drupal:12.0.0. Use \\Drupal\\responsive_image\\ResponsiveImageBuilder::getImageDimensions() instead. See https://www.drupal.org/node/3548329', E_USER_DEPRECATED);
  return \Drupal::service(ResponsiveImageBuilder::class)->getImageDimensions($image_style_name, $dimensions, $uri);
}

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