Index: image_pub.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image_pub/Attic/image_pub.module,v
retrieving revision 1.11.2.2
diff -u -r1.11.2.2 image_pub.module
--- image_pub.module	19 Oct 2007 08:18:13 -0000	1.11.2.2
+++ image_pub.module	19 Oct 2007 08:27:05 -0000
@@ -242,18 +242,28 @@
   $node->type ='image';
   $node->title = $caption;
   $node->body = $description;
-  $node->comment = 0;
   $node->status = 1;
+  $node->comment = variable_get("comment_$node->type", COMMENT_NODE_READ_WRITE);
+  
+  $node_options = variable_get('node_options_image', array('status', 'promote'));
+  foreach (array('status', 'promote', 'sticky', 'revision') as $key) {
+    $node->$key = in_array($key, $node_options) ? 1 : 0;
+  }
   $node->taxonomy = array($album->tid);
   $node->images['_original'] = file_directory_temp() . '/' . $filename;
 
-  // let the image module generate the preview/thumbnail
-  _image_build_derivatives($node, true);
-
-  // save the node
-  node_save($node);
+  if ($node = node_submit($node)) {
+    // let the image module generate the preview/thumbnail
+    _image_build_derivatives($node, true);
+  
+    // save the node
+    node_save($node);
 
+    // delete the temporary file
+    @unlink(file_directory_temp() . '/' . $filename);
+  }
   // FIXME: check that the uploaded image was accepted.
+  watchdog('image_pub', t('%image was added.', array('%image' => $filename)));
   return array('success' => TRUE, 'node' => $node);
 }
 
@@ -312,7 +322,7 @@
   }
   $numref = FALSE;
 
-  watchdog('image_pub', t('Processing command %cmd', array('%cmd' => theme('placeholder', $cmd))));
+  //watchdog('image_pub', t('Processing command %cmd', array('%cmd' => theme('placeholder', $cmd))));
 
   switch($cmd) {
     case 'login':
