diff --git a/modules/image/image.field.inc b/modules/image/image.field.inc index 07cc1e0..eab24ef 100644 --- a/modules/image/image.field.inc +++ b/modules/image/image.field.inc @@ -524,25 +524,25 @@ function image_field_formatter_view($entity_type, $entity, $field, $instance, $l * - image_style: An optional image style. * - path: An array containing the link 'path' and link 'options'. * + * @see theme_image() + * @see theme_image_style() * @ingroup themeable */ function theme_image_formatter($variables) { $item = $variables['item']; - $image = array( - 'path' => $item['uri'], - 'alt' => $item['alt'], - ); - // Do not output an empty 'title' attribute. - if (drupal_strlen($item['title']) > 0) { - $image['title'] = $item['title']; + + // Make sure there is path associated with the image. + if (!isset($item['path'])) { + $item['path'] = $item['uri']; } + // Check to see if we are outputting the image using an image style or not. if ($variables['image_style']) { - $image['style_name'] = $variables['image_style']; - $output = theme('image_style', $image); + $item['style_name'] = $variables['image_style']; + $output = theme('image_style', $item); } else { - $output = theme('image', $image); + $output = theme('image', $item); } if ($variables['path']) {