Index: imagefield_widget.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imagefield/imagefield_widget.inc,v
retrieving revision 1.28
diff -u -r1.28 imagefield_widget.inc
--- imagefield_widget.inc	16 Mar 2009 23:36:18 -0000	1.28
+++ imagefield_widget.inc	17 Mar 2009 00:56:57 -0000
@@ -105,6 +105,13 @@
   if (count(array_diff($extensions, $web_extensions))) {
     form_set_error('file_extensions', t('Only web-standard images (jpg, gif, and png) are supported through the image widget. If needing to upload other types of images, change the widget to use a standard file upload.'));
   }
+
+  // Check that set resolutions are valid.
+  foreach (array('min_resolution', 'max_resolution') as $resolution) {
+    if (!empty($widget[$resolution]) && !preg_match('/^[0-9]+x[0-9]+$/', $widget[$resolution])) {
+      form_set_error($resolution, t('Please specify a resolution in the format WIDTHxHEIGHT (e.g. 640x480).'));
+    }
+  }
 }
 
 /**
