Index: wp-app.php
===================================================================
--- wp-app.php	(revision 18407)
+++ wp-app.php	(working copy)
@@ -620,13 +620,22 @@
 
 		$url = $file['url'];
 		$file = $file['file'];
+		$title = $content = $slug;
 
 		do_action('wp_create_file_in_uploads', $file); // replicate
 
+		// use image exif/iptc data for title and caption defaults if possible
+		if ( $image_meta = @wp_read_image_metadata($file) ) {
+			if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) )
+				$title = $image_meta['title'];
+			if ( trim( $image_meta['caption'] ) )
+				$content = $image_meta['caption'];
+		}
+
 		// Construct the attachment array
 		$attachment = array(
-			'post_title' => $slug,
-			'post_content' => $slug,
+			'post_title' => $title,
+			'post_content' => $content,
 			'post_status' => 'attachment',
 			'post_parent' => 0,
 			'post_mime_type' => $type,
@@ -636,8 +645,11 @@
 		// Save the data
 		$postID = wp_insert_attachment($attachment, $file);
 
-		if (!$postID)
+		if ( is_wp_error( $postID ) ) {
 			$this->internal_error(__('Sorry, your entry could not be posted. Something wrong happened.'));
+		} else {
+			wp_update_attachment_metadata( $postID, wp_generate_attachment_metadata( $postID, $file ) );
+		}
 
 		$output = $this->get_entry($postID, 'attachment');
 
