function picture_get_image_dimensions

Determines the dimensions of an image.

Parameters

$variables: An associative array containing:

  • style_name: The name of the style to be used to alter the original image.
  • width: The width of the source image (if known).
  • height: The height of the source image (if known).

Return value

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

1 call to picture_get_image_dimensions()
theme_picture in drupal/core/modules/picture/picture.module
Returns HTML for a picture.

File

drupal/core/modules/picture/picture.module, line 369
Picture display formatter for image fields.

Code

function picture_get_image_dimensions($variables) {

  // Determine the dimensions of the styled image.
  $dimensions = array(
    'width' => $variables['width'],
    'height' => $variables['height'],
  );
  image_style_transform_dimensions($variables['style_name'], $dimensions);
  return $dimensions;
}