diff --git a/includes/theme.inc b/includes/theme.inc index 28ab8d4..1628144 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1511,9 +1511,9 @@ function theme_image($variables) { $attributes = $variables['attributes']; $attributes['src'] = file_create_url($variables['path']); + // The standard image attributes are only used if they arn't empty. foreach (array('width', 'height', 'alt', 'title') as $key) { - - if (isset($variables[$key])) { + if (isset($variables[$key]) && !empty($variables[$key])) { $attributes[$key] = $variables[$key]; } } diff --git a/modules/image/image.field.inc b/modules/image/image.field.inc index 07cc1e0..0844cba 100644 --- a/modules/image/image.field.inc +++ b/modules/image/image.field.inc @@ -528,21 +528,14 @@ function image_field_formatter_view($entity_type, $entity, $field, $instance, $l */ 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']; - } + $item['path'] = $item['uri']; 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']) {