theme_image($path, $alt = '', $title = '', $attr = '', $getsize = true)
drupal/includes/theme.inc, line 473
Return a themed image.
$path The path of the image file.
$alt The alternative text for text-based browsers.
$title The title text is displayed when the image is hovered in some popular browsers.
$attr Attributes placed in the img tag.
$getsize If set to true, the image's dimension are fetched and added as width/height attributes.
A string containing the image tag.
| Name | Description |
|---|---|
| Themeable functions | Functions that display HTML, and which can be customized by themes. |
function theme_image($path, $alt = '', $title = '', $attr = '', $getsize = true) {
if (!$getsize || (is_file($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) {
return '<img src="'. check_url($path) .'" '. $attr .' alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" />';
}
}