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 21:16:02 -0000
@@ -1099,6 +1099,16 @@ 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	3 Jan 2011 21:16:02 -0000
@@ -695,7 +695,6 @@ class ImageFieldDisplayTestCase extends 
     // 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);
     $this->drupalGet('node/' . $nid);
     $this->assertRaw($default_output, t('Image style thumbnail formatter displaying correctly on full node view.'));
