Index: imagefield.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imagefield/imagefield.module,v
retrieving revision 1.99
diff -u -r1.99 imagefield.module
--- imagefield.module	20 Apr 2009 23:57:17 -0000	1.99
+++ imagefield.module	16 May 2009 22:58:44 -0000
@@ -282,9 +282,17 @@
     return '<!-- File not found: '. $file['filepath'] .' -->';
   }
 
-  if ($getsize && (list($width, $height, $type, $image_attributes) = @getimagesize($file['filepath']))) {
-    $attributes['width'] = $width;
-    $attributes['height'] = $height;
+  if ($getsize) {
+    // Use cached width and height if available.
+    if (!empty($file['data']['width']) && !empty($file['data']['height'])) {
+      $attributes['width']  = $file['data']['width'];
+      $attributes['height'] = $file['data']['height'];
+    }
+    // Otherwise pull the width and height from the file.
+    elseif (list($width, $height, $type, $image_attributes) = @getimagesize($file['filepath'])) {
+      $attributes['width'] = $width;
+      $attributes['height'] = $height;
+    }
   }
 
   if (!empty($title)) {
