Index: image.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/image.module,v
retrieving revision 1.310
diff -u -p -r1.310 image.module
--- image.module	9 Aug 2009 17:19:39 -0000	1.310
+++ image.module	9 Aug 2009 17:20:38 -0000
@@ -1027,6 +1027,12 @@ function image_create_node_from($filepat
     return FALSE;
   }
 
+  // Ensure the file is within our size bounds.
+  if ($image_info['file_size'] > variable_get('image_max_upload_size', 800) * 1024) {
+    form_set_error(NULL, 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))) {
