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	4 Jan 2011 00:49:37 -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);
 }
 
Index: modules/image/image.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/image/image.test,v
retrieving revision 1.31
diff -u -p -r1.31 image.test
--- modules/image/image.test	22 Sep 2010 03:24:09 -0000	1.31
+++ modules/image/image.test	4 Jan 2011 00:49:37 -0000
@@ -694,9 +694,11 @@ class ImageFieldDisplayTestCase extends 
     // Ensure the derivative image is generated so we do not have to deal with
     // image style callback paths.
     $this->drupalGet(image_style_url('thumbnail', $image_uri));
-    $image_info['path'] = image_style_path('thumbnail', $image_uri);
-    $image_info['getsize'] = FALSE;
-    $default_output = theme('image', $image_info);
+    $image_info = array(
+      'style_name' => 'thumbnail',
+      'path' => $image_uri,
+    );
+    $default_output = theme('image_style', $image_info);
     $this->drupalGet('node/' . $nid);
     $this->assertRaw($default_output, t('Image style thumbnail formatter displaying correctly on full node view.'));
 
