--- imagecache.module.orig	2012-02-25 00:21:27.419320263 -0500
+++ imagecache.module	2012-02-25 00:23:54.069406304 -0500
@@ -885,11 +885,18 @@ function theme_imagecache($presetname, $
   if (is_null($attributes)) {
     $attributes = array('class' => 'imagecache imagecache-'. $presetname);
   }
-  if ($getsize && ($image = image_get_info(imagecache_create_path($presetname, $path)))) {
-    $attributes['width'] = $image['width'];
-    $attributes['height'] = $image['height'];
+  if ($getsize) {
+    $cachepath = imagecache_create_path($presetname, $path);
+    if (!is_file($cachepath)) {
+      $preset = imagecache_preset_by_name($presetname);
+      $dst = imagecache_create_path($presetname, $path);
+      imagecache_build_derivative($preset['actions'], $path, $dst);
+    }
+    if ($image = image_get_info($cachepath)) {
+      $attributes['width'] = $image['width'];
+      $attributes['height'] = $image['height'];
+    }
   }
-
   $attributes = drupal_attributes($attributes);
   $imagecache_url = imagecache_create_url($presetname, $path, FALSE, $absolute);
   return '<img src="'. $imagecache_url .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $attributes .' />';
