Index: image_resize_filter.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image_resize_filter/image_resize_filter.module,v
retrieving revision 1.29
diff -u -r1.29 image_resize_filter.module
--- image_resize_filter.module 22 Oct 2009 00:30:34 -0000 1.29
+++ image_resize_filter.module 22 Oct 2009 01:45:17 -0000
@@ -267,6 +267,14 @@
continue;
}
+ // Find the image title if any.
+ $title = NULL;
+ $title_matches = array();
+ preg_match('/title[ ]*=[ ]*"([^"]+)"/', $img_tag, $title_matches);
+ if (isset($title_matches[1])) {
+ $title = $title_matches[1];
+ }
+
// Check the image extension.
$extension_matches = array();
preg_match('/.([a-zA-Z0-9]+)$/', $src, $extension_matches);
@@ -354,6 +362,7 @@
'expected_size' => array('width' => $width, 'height' => $height),
'actual_size' => array('width' => $image_size[0], 'height' => $image_size[1]),
'add_properties' => array('width' => $needs_width, 'height' => $needs_height),
+ 'title' => $title,
'original' => $src,
'location' => $location,
'local_path' => $local_path,
@@ -486,7 +495,8 @@
if ($settings['link']) {
$class = !empty($settings['class']) ? ' class="'. $settings['class'] .'"' : '';
$rel = !empty($settings['rel']) ? ' rel="'. $settings['rel'] .'"' : '';
- $output = ''. $output .'';
+ $title = !empty($image['title']) ? ' title="'. $image['title'] .'"' : '';
+ $output = ''. $output .'';
}
return $output;