--- plupload.module	2011-01-17 16:34:03.000000000 -0500
+++ plupload.module	2011-02-13 12:41:23.631359683 -0500
@@ -76,6 +76,33 @@ function plupload_admin_settings() {
     );
   }
 
+  // Resize Settings
+  $form['resize'] = array(
+    '#title' => 'Resize',
+    '#type' => 'fieldset',
+  );
+  $form['resize']['plupload_resize_width'] = array(
+    '#title' => t('Width'),
+    '#default_value' => variable_get('plupload_resize_width', NULL),
+    '#type' => 'textfield',
+    '#size' => 6,
+    '#attributes' => array('style' => 'text-align: right'),
+  );
+  $form['resize']['plupload_resize_height'] = array(
+    '#title' => t('Height'),
+    '#default_value' => variable_get('plupload_resize_height', NULL),
+    '#type' => 'textfield',
+    '#size' => 6,
+    '#attributes' => array('style' => 'text-align: right'),
+  );
+  $form['resize']['plupload_resize_quality'] = array(
+    '#title' => t('Quality'),
+    '#default_value' => variable_get('plupload_resize_quality', NULL),
+    '#type' => 'textfield',
+    '#size' => 6,
+    '#attributes' => array('style' => 'text-align: right'),
+  );
+
   return system_settings_form($form);
 }
 
@@ -109,24 +136,29 @@ function plupload_upload_page($options =
 
   $url = url('plupload-pernode', array('query' => $query_string));
   $swfurl = url($path .'/plupload/js/plupload.flash.swf');
+  $max_file_size = strtolower(str_replace(' ', '', format_size(parse_size(file_upload_max_size()))));
+  $resize = plupload_resize_conf();
   $script = <<<__RSD__
 // Convert divs to queue widgets when the DOM is ready
  $(function() {
   // Setup uploader
   $("#uploader").pluploadQueue({
-       // General settings
-       runtimes : 'html5,flash,html4',
-       url : '$url',
-       max_file_size : '10mb',
-       chunk_size : '1mb',
-       unique_names : false,
-       flash_swf_url : '$swfurl',
-
-       // Specify what files to browse for
-       filters : [
-           {title : "Image files", extensions : "$extensions"}
-       ]
-   });
+    // General settings
+    runtimes : 'html5,flash,html4',
+    url : '$url',
+    max_file_size : '$max_file_size',
+    chunk_size : '1mb',
+    unique_names : false,
+    flash_swf_url : '$swfurl',
+
+    // Resize images on clientside if we can
+    $resize
+
+    // Specify what files to browse for
+    filters : [
+      {title : "Image files", extensions : "$extensions"}
+    ]
+  });
 });
 __RSD__;
 
@@ -138,6 +170,19 @@ __RSD__;
   return $output;
 }
 
+function plupload_resize_conf() {
+  $conf = array();
+  foreach(array('width', 'height', 'quality') as $variable) {
+    $val = variable_get('plupload_resize_' . $variable, 1);
+    if ($val) {
+      $conf[$variable] = $val;
+    }
+  }
+  if ($conf) {
+    return 'resize : ' . drupal_to_js($conf) . ',';
+  }
+}
+
 function plupload_pernode() {
   $temp_directory = file_directory_temp();
 
