Determines the dimensions of the styled image.
Applies all of an image style's effects to $dimensions.
$style_name: The name of the style to be applied.
$dimensions: Dimensions to be modified - an array with components width and height, in pixels.
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;
}
}
}