Index: image.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/image.module,v
retrieving revision 1.302
diff -u -r1.302 image.module
--- image.module  9 Mar 2009 02:24:33 -0000 1.302
+++ image.module  5 Apr 2009 08:44:30 -0000
@@ -1013,6 +1013,11 @@
     return FALSE;
   }
 
+  // Ensure the file is within our size bounds.
+  if ($image_info['file_size'] > variable_get('image_max_upload_size', 800) * 1024) {
+    drupal_set_message(t('The image you uploaded was too big. You are only allowed upload files less than %max_size but your file was %file_size.', array('%max_size' => format_size(variable_get('image_max_upload_size', 800) * 1024), '%file_size' => format_size($file->filesize))), 'warning');
+    return FALSE;
+  }
+  
   // Make sure we can copy the file into our temp directory.
   $original_path = $filepath;
   if (!file_copy($filepath, _image_filename($filepath, IMAGE_ORIGINAL, TRUE))) {
