Index: modules/image/image.field.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/image/image.field.inc,v
retrieving revision 1.34
diff -u -p -r1.34 image.field.inc
--- modules/image/image.field.inc	31 Oct 2010 12:12:00 -0000	1.34
+++ modules/image/image.field.inc	16 Jan 2011 00:32:12 -0000
@@ -50,7 +50,8 @@ function image_field_settings_form($fiel
     '#options' => $scheme_options,
     '#default_value' => $settings['uri_scheme'],
     '#description' => t('Select where the final files should be stored. Private file storage has significantly more overhead than public files, but allows restricted access to files within this field.'),
-  );
+  ) + element_info('radios');
+  array_unshift($form['uri_scheme']['#process'], 'image_field_settings_uri_scheme_process');
 
   $form['default_image'] = array(
     '#title' => t('Default image'),
@@ -556,3 +557,15 @@ function theme_image_formatter($variable
 
   return $output;
 }
+
+function image_field_settings_uri_scheme_process($element, $form_state, &$complete_form) {
+  $array_parents = $element['#array_parents'];
+  // Remove the uri_scheme key and add default_image instead.
+  $array_parents[count($array_parents) - 1] = 'default_image';
+  $default_image_element = &$complete_form;
+  foreach ($array_parents as $key) {
+    $default_image_element = &$default_image_element[$key];
+  }
+  $default_image_element['#upload_location'] = $element['#value'] . '://default_image';
+  return $element;
+}
Index: modules/image/image.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/image/image.module,v
retrieving revision 1.55
diff -u -p -r1.55 image.module
--- modules/image/image.module	13 Jan 2011 01:08:28 -0000	1.55
+++ modules/image/image.module	16 Jan 2011 00:32:14 -0000
@@ -1129,3 +1129,44 @@ function image_filter_keyword($value, $c
 function _image_effect_definitions_sort($a, $b) {
   return strcasecmp($a['name'], $b['name']);
 }
+
+/**
+ * Implements hook_field_delete_field().
+ */
+function image_field_delete_field($field) {
+  if ($field['type'] != 'image') {
+    return;
+  }
+
+  $fid = (is_array($field['settings']['default_image']) ? $field['settings']['default_image']['fid'] : $field['settings']['default_image']);
+  if ($fid && ($file = file_load($fid))) {
+    file_usage_delete($file, 'image', 'default_image', $field['id'], 1);
+  }
+}
+
+/**
+ * Implements hook_field_update_field().
+ */
+function image_field_update_field($field, $prior_field, $has_data) {
+  if ($field['type'] != 'image') {
+    return;
+  }
+
+  // The value of a file_managed element can be array if the #extended == TRUE
+  $fid_new = (is_array($field['settings']['default_image']) ? $field['settings']['default_image']['fid'] : $field['settings']['default_image']);
+  $fid_old = (is_array($prior_field['settings']['default_image']) ? $prior_field['settings']['default_image']['fid'] : $prior_field['settings']['default_image']);
+  if ($fid_new != $fid_old) {
+    if ($fid_new && ($file_new = file_load($fid_new))) {
+      // Has no constant for the temporary status?
+      if ($file_new->status != FILE_STATUS_PERMANENT) {
+        $file_new->status = FILE_STATUS_PERMANENT;
+        file_save($file_new);
+      }
+      file_usage_add($file_new, 'image', 'default_image', $field['id'], 1);
+    }
+
+    if ($fid_old && ($file_old = file_load($fid_old))) {
+      file_usage_delete($file_old, 'image', 'default_image', $field['id'], 1);
+    }
+  }
+}
