function image_style_transform_dimensions

Determines the dimensions of the styled image.

Applies all of an image style's effects to $dimensions.

Parameters

$style_name: The name of the style to be applied.

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

1 call to image_style_transform_dimensions()
theme_image_style in modules/image/image.module
Returns HTML for an image using a specific image style.

File

modules/image/image.module, line 1030

Code

function image_style_transform_dimensions($style_name, array &$dimensions) {
    module_load_include('inc', 'image', 'image.effects');
    $style = image_style_load($style_name);
    if (!is_array($style)) {
        return;
    }
    foreach ($style['effects'] as $effect) {
        if (isset($effect['dimensions passthrough'])) {
            continue;
        }
        if (isset($effect['dimensions callback'])) {
            $effect['dimensions callback']($dimensions, $effect['data']);
        }
        else {
            $dimensions['width'] = $dimensions['height'] = NULL;
        }
    }
}

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