diff --git a/wp-includes/class.wp-xmlrpc-server.php b/wp-includes/class.wp-xmlrpc-server.php
index 6aa9aa4..9487a93 100644
--- a/wp-includes/class.wp-xmlrpc-server.php
+++ b/wp-includes/class.wp-xmlrpc-server.php
@@ -61,6 +61,8 @@ class wp_xmlrpc_server extends IXR_Server {
 			'wp.editComment'		=> 'this:wp_editComment',
 			'wp.newComment'			=> 'this:wp_newComment',
 			'wp.getCommentStatusList' => 'this:wp_getCommentStatusList',
+			'wp.getMediaItem'		=> 'this:wp_getMediaItem',
+			'wp.getMediaLibrary'	=> 'this:wp_getMediaLibrary',
 
 			// Blogger API
 			'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs',
@@ -1446,6 +1448,113 @@ class wp_xmlrpc_server extends IXR_Server {
 		return $this->_getOptions($option_names);
 	}
 
+	/**
+	 * Retrieve media item.
+	 *
+	 * @since unknown
+	 *
+	 * @param array $args Method parameters.
+	 * @return array
+	 */
+	function wp_getMediaItem($args) {
+		$this->escape($args);
+
+		$blog_id		= (int) $args[0];
+		$username		= $args[1];
+		$password		= $args[2];
+		$attachment_id	= (int) $args[3];
+
+		if ( !$user = $this->login($username, $password) )
+			return $this->error;
+
+		if ( !current_user_can( 'upload_files' ) )
+			return new IXR_Error( 403, __( 'You are not allowed to upload files on this site.' ) );
+
+		do_action('xmlrpc_call', 'wp.getMediaItem');
+
+		if ( ! $attachment = get_post($attachment_id) )
+			return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
+
+		// Format page date.
+		$attachment_date = mysql2date("Ymd\TH:i:s", $attachment->post_date, false);
+		$attachment_date_gmt = mysql2date("Ymd\TH:i:s", $attachment->post_date_gmt, false);
+
+		$link = wp_get_attachment_url($attachment->ID);
+		$thumbnail_link = wp_get_attachment_thumb_url($attachment->ID);
+
+		$attachment_struct = array(
+			"date_created_gmt"		=> new IXR_Date($attachment_date_gmt),
+			"parent"				=> $attachment->post_parent,
+			"link"					=> $link,
+			"thumbnail"				=> $thumbnail_link,
+			"title"					=> $attachment->post_title,
+			"caption"				=> $attachment->post_excerpt,
+			"description"			=> $attachment->post_content,
+			"metadata"				=> wp_get_attachment_metadata($attachment->ID),
+		);
+
+		return $attachment_struct;
+	}
+
+	/**
+	 * Retrieve media library items.
+	 *
+	 * @since unknown
+	 *
+	 * @param array $args Method parameters.
+	 * @return array
+	 */
+	function wp_getMediaLibrary($args) {
+		$raw_args = $args;
+		$this->escape($args);
+
+		$blog_id	= (int) $args[0];
+		$username	= $args[1];
+		$password	= $args[2];
+		$struct		= $args[3];
+
+		if ( !$user = $this->login($username, $password) )
+			return $this->error;
+
+		if ( !current_user_can( 'upload_files' ) )
+			return new IXR_Error( 401, __( 'Sorry, you cannot upload files.' ) );
+
+		do_action('xmlrpc_call', 'wp.getMediaLibrary');
+
+		$parent_id = '';
+		if ( isset($struct['parent_id']) )
+			$parent_id = absint($struct['parent_id']);
+
+		$mime_type = '';
+		if ( isset($struct['mime_type']) )
+			$mime_type = $struct['mime_type'];
+
+		$offset = 0;
+		if ( isset($struct['offset']) )
+			$offset = absint($struct['offset']);
+
+		$number = -1;
+		if ( isset($struct['number']) )
+			$number = absint($struct['number']);
+
+		$attachments = get_posts( array('post_type' => 'attachment', 'post_parent' => $parent_id, 'offset' => $offset, 'numberposts' => $number, 'post_mime_type' => $mime_type ) );
+		$num_attachments = count($attachments);
+
+		if ( ! $num_attachments )
+			return array();
+
+		$attachments_struct = array();
+
+		for ( $i = 0; $i < $num_attachments; $i++ ) {
+			$attachment = wp_xmlrpc_server::wp_getMediaItem(array(
+				$raw_args[0], $raw_args[1], $raw_args[2], $attachments[$i]->ID,
+			));
+			$attachments_struct[] = $attachment;
+		}
+
+		return $attachments_struct;
+	}
+
 	/* Blogger API functions.
 	 * specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/
 	 */
