On this page
function image_style_transform_dimensions
image_style_transform_dimensions($style_name, array &$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.
File
- modules/image/image.module, line 953
- Exposes global functionality for creating image styles.
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;
}
}
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!image!image.module/function/image_style_transform_dimensions/7.x