Index: upload.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.admin.inc,v
retrieving revision 1.12
diff -u -r1.12 upload.admin.inc
--- upload.admin.inc	21 May 2009 12:00:06 -0000	1.12
+++ upload.admin.inc	24 Jul 2009 13:53:10 -0000
@@ -10,9 +10,14 @@
  * Form API callback to validate the upload settings form.
  */
 function upload_admin_settings_validate($form, &$form_state) {
-  if (($form_state['values']['upload_max_resolution'] != '0')) {
-    if (!preg_match('/^[0-9]+x[0-9]+$/', $form_state['values']['upload_max_resolution'])) {
-      form_set_error('upload_max_resolution', t('The maximum allowed image size expressed as WIDTHxHEIGHT (e.g. 640x480). Set to 0 for no restriction.'));
+  if (($form_state['values']['upload_max_resolution_x'] != '0')) {
+    if (!is_numeric($form_state['values']['upload_max_resolution_x'])) {
+      form_set_error('upload_max_resolution_x', t('The maximum allowed image size should be entered as a numeric value. Set to 0 for no restriction.'));
+    }
+  }
+  if (($form_state['values']['upload_max_resolution_y'] != '0')) {
+    if (!is_numeric($form_state['values']['upload_max_resolution_y'])) {
+      form_set_error('upload_max_resolution_y', t('The maximum allowed image size should be entered as a numeric value. Set to 0 for no restriction.'));
     }
   }
 
@@ -70,13 +75,27 @@
     '#collapsible' => TRUE,
   );
   $form['settings_general']['upload_max_resolution'] = array(
-    '#type' => 'textfield',
+    '#type' => 'item',
     '#title' => t('Maximum resolution for uploaded images'),
-    '#default_value' => variable_get('upload_max_resolution', 0),
-    '#size' => 15,
-    '#maxlength' => 10,
-    '#description' => t('The maximum allowed image size (e.g. 640x480). Set to 0 for no restriction. If an <a href="!image-toolkit-link">image toolkit</a> is installed, files exceeding this value will be scaled down to fit.', array('!image-toolkit-link' => url('admin/settings/image-toolkit'))),
-    '#field_suffix' => '<kbd>' . t('WIDTHxHEIGHT') . '</kbd>'
+    '#description' => t('The maximum allowed image size (e.g. 640x480). Set to 0x0 for no restriction. If an <a href="!image-toolkit-link">image toolkit</a> is installed, files exceeding this value will be scaled down to fit.', array('!image-toolkit-link' => url('admin/settings/image-toolkit'))),
+    '#prefix' => '<div class="form-item-wrapper form-item-resolution">',
+    '#suffix' => '</div>',
+  );
+  $form['settings_general']['upload_max_resolution']['upload_max_resolution_x'] = array(
+    '#type' => 'textfield',
+    '#default_value' => variable_get('upload_max_resolution_x', 0),
+    '#size' => 5,
+    '#maxlength' => 5,
+    '#field_prefix' => t('Width'),
+    '#field_suffix' => t('pixels'),
+  );
+  $form['settings_general']['upload_max_resolution']['upload_max_resolution_y'] = array(
+    '#type' => 'textfield',
+    '#default_value' => variable_get('upload_max_resolution_y', 0),
+    '#size' => 5,
+    '#maxlength' => 5,
+	'#field_prefix' => t('Height'),
+    '#field_suffix' => t('pixels'),
   );
   $form['settings_general']['upload_list_default'] = array(
     '#type' => 'select',
Index: upload.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v
retrieving revision 1.244
diff -u -r1.244 upload.module
--- upload.module	5 Jul 2009 18:00:11 -0000	1.244
+++ upload.module	24 Jul 2009 13:48:38 -0000
@@ -142,7 +142,7 @@
     'extensions' => $all_extensions,
     'file_size' => $file_limit,
     'user_size' => $user_limit,
-    'resolution' => variable_get('upload_max_resolution', 0),
+    'resolution' => variable_get('upload_max_resolution_x', 0) . 'x' . variable_get('upload_max_resolution_y', 0),
   );
 }
 

