Full ELMS Learning Network documentation
function theme_image_style
×
Error message
User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).cis7 image.module | theme_image_style($variables) |
cle7 image.module | theme_image_style($variables) |
elmsmedia7 image.module | theme_image_style($variables) |
icor7 image.module | theme_image_style($variables) |
meedjum_blog7 image.module | theme_image_style($variables) |
mooc7 image.module | theme_image_style($variables) |
Returns HTML for an image using a specific image style.
Parameters
$variables: An associative array containing:
- style_name: The name of the style to be used to alter the original image.
- path: The path of the image file relative to the Drupal files directory. This function does not work with images outside the files directory nor with remotely hosted images. This should be in a format such as 'images/image.jpg', or using a stream wrapper such as 'public://images/image.jpg'.
- width: The width of the source image (if known).
- height: The height of the source image (if known).
- alt: The alternative text for text-based browsers.
- title: The title text is displayed when the image is hovered in some popular browsers.
- attributes: Associative array of attributes to be placed in the img tag.
Related topics
8 theme calls to theme_image_style()
- ds_render_user_picture in sites/
all/ modules/ ulmus/ ds/ ds.module - Render a user picture.
- image_field_widget_process in modules/
image/ image.field.inc - An element #process callback for the image_image field type.
- template_preprocess_user_picture in modules/
user/ user.module - Process variables for user-picture.tpl.php.
- theme_image_formatter in modules/
image/ image.field.inc - Returns HTML for an image field formatter.
- theme_lightbox2_image in sites/
all/ modules/ ulmus/ lightbox2/ lightbox2.formatter.inc - Theme function for displaying the lightbox2 trigger image in an imagefield.
48 string references to the theme hook from theme_image_style()
Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.
- ds_render_user_picture in sites/
all/ modules/ ulmus/ ds/ ds.module - Render a user picture.
- file_entity_file_formatter_file_image_settings in sites/
all/ modules/ ulmus/ file_entity/ file_entity.module - Implements hook_file_formatter_FORMATTER_settings().
- file_entity_file_formatter_file_image_view in sites/
all/ modules/ ulmus/ file_entity/ file_entity.module - Implements hook_file_formatter_FORMATTER_view().
- file_entity_file_formatter_info in sites/
all/ modules/ ulmus/ file_entity/ file_entity.module - Implements hook_file_formatter_info().
- imageinfo_cache_get_image_styles_in_views in sites/
all/ modules/ ulmus/ imageinfo_cache/ imageinfo_cache.inc - Given a field name, will return image styles used in views for that field.
File
- modules/
image/ image.module, line 1346 - Exposes global functionality for creating image styles.
Code
function theme_image_style($variables) {
// Determine the dimensions of the styled image.
$dimensions = array(
'width' => $variables['width'],
'height' => $variables['height'],
);
image_style_transform_dimensions($variables['style_name'], $dimensions);
$variables['width'] = $dimensions['width'];
$variables['height'] = $dimensions['height'];
// Determine the URL for the styled image.
$variables['path'] = image_style_url($variables['style_name'], $variables['path']);
return theme('image', $variables);
}