--- C:\Documents and Settings\lmackenzie1016\Desktop\Downloads\image\image.module 2009-09-13 21:21:04.000000000 -0000 +++ C:\Documents and Settings\lmackenzie1016\Desktop\image.module 2010-02-17 13:52:34.000000000 -0000 @@ -1036,16 +1036,18 @@ * String to be used as the node's title. If this is ommitted the filename * will be used. * @param $body * String to be used as the node's body. * @param $taxonomy * Taxonomy terms to assign to the node if the taxonomy.module is installed. + * @param $keep_original + * Boolean to indicate whether the original file should be deleted * @return * A node object if the node is created successfully or FALSE on error. */ -function image_create_node_from($filepath, $title = NULL, $body = '', $taxonomy = NULL) { +function image_create_node_from($filepath, $title = NULL, $body = '', $taxonomy = NULL, $keep_original = FALSE) { global $user; if (!user_access('create images')) { return FALSE; } @@ -1046,20 +1048,22 @@ global $user; if (!user_access('create images')) { return FALSE; } $node->images[IMAGE_ORIGINAL] = $filepath; // Save the node. $node = node_submit($node); node_save($node); - // Remove the original image now that the import has completed. - file_delete($original_path); + // Remove the original image now that the import has completed (if $keep_original not set) + if ($keep_original !== TRUE) { + file_delete($original_path); + } return $node; } /** * Implementation of hook_views_api().