? .cvsignore
Index: imagecache.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imagecache/imagecache.module,v
retrieving revision 1.104
diff -u -p -r1.104 imagecache.module
--- imagecache.module	29 Apr 2009 15:19:06 -0000	1.104
+++ imagecache.module	2 May 2009 14:59:39 -0000
@@ -653,7 +653,11 @@ function theme_imagecache_formatter_defa
     return '';
   }
 
-  list($presetname, $style) = explode('_', $element['#formatter'], 2);
+  // Extract the preset name from the formatter name.
+  $presetname = substr($element['#formatter'], 0, strrpos($element['#formatter'], '_'));
+  $style = 'linked';
+  $style = 'default';
+
   $item = $element['#item'];
   $item['data']['alt'] = isset($item['data']['alt']) ? $item['data']['alt'] : '';
   $item['data']['title'] = isset($item['data']['title']) ? $item['data']['title'] : NULL;
@@ -668,7 +672,10 @@ function theme_imagecache_formatter_link
     return '';
   }
 
-  list($presetname, $style) = explode('_', $element['#formatter'], 2);
+  // Extract the preset name from the formatter name.
+  $presetname = substr($element['#formatter'], 0, strrpos($element['#formatter'], '_'));
+  $style = 'linked';
+
   $item = $element['#item'];
   $item['data']['alt'] = isset($item['data']['alt']) ? $item['data']['alt'] : '';
   $item['data']['title'] = isset($item['data']['title']) ? $item['data']['title'] : NULL;
@@ -685,7 +692,10 @@ function theme_imagecache_formatter_imag
     return '';
   }
 
-  list($presetname, $style) = explode('_', $element['#formatter'], 2);
+  // Extract the preset name from the formatter name.
+  $presetname = substr($element['#formatter'], 0, strrpos($element['#formatter'], '_'));
+  $style = 'imagelink';
+
   $item = $element['#item'];
   $item['data']['alt'] = isset($item['data']['alt']) ? $item['data']['alt'] : '';
   $item['data']['title'] = isset($item['data']['title']) ? $item['data']['title'] : NULL;
@@ -702,10 +712,10 @@ function theme_imagecache_formatter_path
     return '';
   }
 
-  list($presetname, $style) = explode('_', $element['#formatter'], 2);
-  $item = $element['#item'];
+  // Extract the preset name from the formatter name.
+  $presetname = substr($element['#formatter'], 0, strrpos($element['#formatter'], '_'));
 
-  return imagecache_create_path($presetname, $item['filepath']);
+  return imagecache_create_path($presetname, $element['#item']['filepath']);
 }
 
 function theme_imagecache_formatter_url($element) {
@@ -714,10 +724,10 @@ function theme_imagecache_formatter_url(
     return '';
   }
 
-  list($presetname, $style) = explode('_', $element['#formatter'], 2);
-  $item = $element['#item'];
+  // Extract the preset name from the formatter name.
+  $presetname = substr($element['#formatter'], 0, strrpos($element['#formatter'], '_'));
 
-  return imagecache_create_url($presetname, $item['filepath']);
+  return imagecache_create_url($presetname, $element['#item']['filepath']);
 }
 
 /**
