Index: imagecache.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imagecache/imagecache.module,v
retrieving revision 1.96
diff -u -p -r1.96 imagecache.module
--- imagecache.module	6 Jan 2009 02:26:38 -0000	1.96
+++ imagecache.module	6 Feb 2009 11:38:13 -0000
@@ -594,8 +594,12 @@ function imagecache_field_formatter_info
 }
 
 function theme_imagecache_formatter($element) {
-  if (isset($element['#item']['nid']) && $node = node_load($element['#item']['nid'])) {
-    return imagecache_field_formatter($element['#field_name'], $element['#item'], $element['#formatter'], $node);
+  if (isset($element['#node']->nid) && $node = node_load($element['#node']->nid)) {
+    $field = content_fields($element['#field_name'], $element['#node']->type);
+    module_load_include('inc', 'imagefield', 'imagefield_formatter');
+    if (imagefield_formatter_prepare_item($element, $field)) {
+      return imagecache_field_formatter($field, $element['#item'], $element['#formatter'], $node);
+    }
   }
 }
 
@@ -604,16 +608,6 @@ function theme_imagecache_formatter($ele
  * Implementation of hook_field_formatter().
  */
 function imagecache_field_formatter($field, $item, $formatter, $node) {
-  if (empty($item['fid']) && $field['use_default_image']) {
-    $item = $field['default_image'];
-  }
-  // Views does not load the file for us, while CCK display fields does.
-  if (empty($item['filepath'])) {
-    $item = array_merge($item, field_file_load($item['fid']));
-  }
-  if (is_string($item['data'])) {
-    $item['data'] = unserialize($item['data']);
-  }
   $alt = empty($item['data']['alt']) ? '' : $item['data']['alt'];
   $title = empty($item['data']['title']) ? '' : $item['data']['title'];
   $parts =  explode('_', $formatter);
@@ -640,7 +634,7 @@ function imagecache_field_formatter($fie
         return imagecache_create_path($presetname, $item['filepath']);
 
       default:
-        return theme('imagecache', $presetname, $item['filepath'], $item['data']['alt'], $item['data']['title'], array('class' => $class));
+        return theme('imagecache', $presetname, $item['filepath'], $alt, $title, array('class' => $class));
     }
   }
   return '<!-- imagecache formatter preset('. $presetname .') not found! -->';
