You are here

function picture_get_image_dimensions in Picture 7.2

Same name and namespace in other branches
  1. 7 picture.module \picture_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: Dimensions to be modified - an array with components width and height, in pixels.

3 calls to picture_get_image_dimensions()
theme_picture in ./picture.module
Returns HTML for a picture.
theme_picture_sizes_formatter in ./picture.module
Theme pictue sizes formatter.
_picture_filter_prepare_image in ./picture.module
Prepares a Render Array for theme_picture_formatter().

File

./picture.module, line 1685
Picture formatter.

Code

function picture_get_image_dimensions($image_style_name, array &$dimensions) {
  if ($image_style_name == PICTURE_EMPTY_IMAGE) {
    $dimensions = array(
      'width' => 1,
      'height' => 1,
    );
  }
  elseif ($image_style_name == PICTURE_ORIGINAL_IMAGE) {

    // NOOP.
  }
  else {
    image_style_transform_dimensions($image_style_name, $dimensions);
  }
  return $dimensions;
}