Index: modules/image/image.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/image/image.module,v
retrieving revision 1.54
diff -u -p -r1.54 image.module
--- modules/image/image.module	18 Nov 2010 05:36:27 -0000	1.54
+++ modules/image/image.module	3 Jan 2011 00:54:14 -0000
@@ -1099,6 +1099,14 @@ function theme_image_style($variables) {
     $style_path = image_style_url($style_name, $path);
   }
   $variables['path'] = $style_path;
+  
+  // If getsize is set determine the width and height of the image before
+  // themeing.
+  if ($variables['getsize'] && (is_file($style_path) && (list($width, $height, $type, $attributes) = @getimagesize($style_path)))) {
+    $variables['width'] = $width;
+    $variables['height'] = $height;
+  }
+  
   return theme('image', $variables);
 }
 
