Index: CHANGELOG.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/CHANGELOG.txt,v
retrieving revision 1.43
diff -u -r1.43 CHANGELOG.txt
--- CHANGELOG.txt 22 Mar 2009 18:36:37 -0000  1.43
+++ CHANGELOG.txt 2 Apr 2009 13:12:34 -0000
@@ -6,6 +6,8 @@
 
 Image 6.x-1.x, xxxx-xx-xx
 -------------------------
+#368505 by joachim: Added a fieldset for image form items, and added an 
+  implementation of CCK's hook_content_extra_fields to expose it for weighting.
 #228886 by joachim: Fixed missing CSS class on unpublished attached images.
 #256195 by dman, sun: Added invocation of hook_file_metadata() to Image Import.
 #362818 by sun: Fixed validation/submission of Image Import settings form.
Index: image.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/image.module,v
retrieving revision 1.302
diff -u -r1.302 image.module
--- image.module  9 Mar 2009 02:24:33 -0000 1.302
+++ image.module  5 Apr 2009 08:22:14 -0000
@@ -328,32 +328,35 @@
     );
   }
 
-  $form['thumbnail'] = array(
-    '#type' => 'item',
-    '#weight' => -10,
-    '#after_build' => array('image_form_add_thumbnail'),
-  );
-
   $form['new_file'] = array(
     '#type' => 'value',
     '#default_value' => isset($node->new_file) ? $node->new_file : FALSE,
   );
-  $form['rebuild_images'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Rebuild derivative images'),
-    '#default_value' => FALSE,
-    '#description' => t('Check this to rebuild the derivative images for this node.'),
-    '#access' => (!isset($node->nid) ? FALSE : TRUE),
-  );
 
   $form['#attributes'] = array('enctype' => 'multipart/form-data');
+  
   $form['image'] = array(
+    '#prefix' => '<div class="image-field-wrapper">',
+    '#suffix' => '</div>',
+    );
+  $form['image']['thumbnail'] = array(
+    '#type' => 'item',
+    '#after_build' => array('image_form_add_thumbnail'),
+  );
+  $form['image']['image'] = array(
     '#type' => 'file',
     '#title' => t('Image'),
     '#size' => 40,
     '#description' => t('Select an image to upload.'),
-    '#weight' => -3,
   );
+  $form['image']['rebuild_images'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Rebuild derivative images'),
+    '#default_value' => FALSE,
+    '#description' => t('Check this to rebuild the derivative images for this node.'),
+    '#access' => (!isset($node->nid) ? FALSE : TRUE),
+  );
+  
   if ($type->has_body) {
     $form['body_field'] = node_body_field($node, $type->body_label, $type->min_word_count);
   }
@@ -1068,3 +1071,18 @@
   );
 }
 
+/**
+ * Implementation of hook_content_extra_fields().
+ *
+ * Lets CCK expose the image weight in the node content.
+ */
+function image_content_extra_fields($type_name) {
+  if ($type_name == 'image') {
+    $extra['image'] = array(
+      'label' => t('Image'),
+      'description' => t('Image display.'),
+      'weight' => 0,
+    );
+    return $extra;
+  }
+}
