--- filefield.module	2010-10-06 15:13:18.000000000 +0200
+++ filefield.module	2010-10-06 15:13:53.000000000 +0200
@@ -796,6 +796,13 @@ function filefield_validate_image_resolu
           $res = imageapi_image_open($file->filepath);
           imageapi_image_scale($res, $max_width, $max_height);
           imageapi_image_close($res, $file->filepath);
+
+          drupal_set_message(t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', array('%dimensions' => $maximum_dimensions)));
+
+          // Clear the cached filesize and refresh the image information.
+          clearstatcache();
+          $info = image_get_info($file->filepath);
+          $file->filesize = $info['file_size'];
         }
         // Try to resize the image to fit the dimensions.
         elseif (image_get_toolkit() && @image_scale($file->filepath, $file->filepath, $max_width, $max_height)) {

