diff -u -p -u -r1.2 CoverArtDatabase.py
--- plugins/artdisplay/artdisplay/CoverArtDatabase.py	12 May 2006 16:54:40 -0000	1.2
+++ plugins/artdisplay/artdisplay/CoverArtDatabase.py	22 May 2006 03:07:15 -0000
@@ -19,6 +19,7 @@
 import rhythmdb
 import os
 import gtk
+import urlparse, urllib
 
 from AmazonCoverArtSearch import AmazonCoverArtSearch
 from Loader import Loader
@@ -81,6 +82,22 @@ class CoverArtDatabase (object):
 			# Otherwise spawn (online) search-engine search
 			se = self.create_search ()
 			se.search (db, entry, self.on_search_engine_results, callback)
+
+	def set_art_from_uri (self, db, entry, uri):
+		st_artist = db.entry_get (entry, rhythmdb.PROP_ARTIST)
+		st_album = db.entry_get (entry, rhythmdb.PROP_ALBUM)
+		art_location = self.build_art_cache_filename (st_album, st_artist, "jpg")
+
+		path = urllib.url2pathname (urlparse.urlparse (uri, 'file')[2])
+		pixbuf = gtk.gdk.pixbuf_new_from_file (path)
+		pixbuf.save (art_location, "jpeg")
+
+	def get_art_uri (self, db, entry):
+		st_artist = db.entry_get (entry, rhythmdb.PROP_ARTIST)
+		st_album = db.entry_get (entry, rhythmdb.PROP_ALBUM)
+
+		art_location = self.build_art_cache_filename (st_album, st_artist, "jpg")
+		return urlparse.urlunparse(('file', '', urllib.pathname2url (art_location), '', '', ''))
 
 	def on_search_engine_results (self, search_engine, entry, results, callback):
 		if results is None:
diff -u -p -u -r1.2 __init__.py
--- plugins/artdisplay/artdisplay/__init__.py	20 May 2006 03:45:34 -0000	1.2
+++ plugins/artdisplay/artdisplay/__init__.py	22 May 2006 03:07:18 -0000
@@ -34,10 +35,18 @@ class ArtDisplayPlugin (rb.Plugin):
 		sp = shell.get_player ()
 		self.pec_id = sp.connect ('playing-song-changed', self.playing_entry_changed)
 		self.pc_id = sp.connect ('playing-changed', self.playing_changed)
+
 		self.art_widget = gtk.Image ()
 		self.art_widget.set_padding (0, 5)
 		shell.add_widget (self.art_widget, rb.SHELL_UI_LOCATION_SIDEBAR)
 		self.sa_id = self.art_widget.connect ('size-allocate', self.size_allocated)
+
+		targets = gtk.target_list_add_uri_targets ()
+		self.art_widget.drag_source_set (gtk.gdk.BUTTON1_MASK, targets, gtk.gdk.ACTION_COPY)
+		self.art_widget.connect ('drag-data-get', self.image_drag_data_get)
+		self.art_widget.drag_dest_set (gtk.DEST_DEFAULT_ALL, targets, gtk.gdk.ACTION_COPY)
+		self.art_widget.connect ('drag-data-received', self.image_drag_data_received)
+
 		self.current_pixbuf = None
 		self.art_db = CoverArtDatabase ()
 		self.resize_id = 0
@@ -161,3 +170,16 @@ class ArtDisplayPlugin (rb.Plugin):
 				mode = gtk.gdk.INTERP_HYPER
 			self.art_widget.set_from_pixbuf (self.current_pixbuf.scale_simple (width, height, mode))
 			self.art_widget.show ()
+
+	def image_drag_data_get (self, widget, drag_context, selection_data, info, timestamp):
+		uri = self.art_db.get_art_uri (self.current_entry)
+		selection_data.set_uris ([uri])
+
+	def image_drag_data_received (self, widget, drag_context, x, y, selection_data, info, timestamp):
+		db = self.shell.get_property ("db")
+
+		uris = selection_data.get_uris ()
+		self.art_db.set_art_from_uri (db, self.current_entry, uris[0])
+
+		self.art_db.get_pixbuf(db, self.current_entry, self.on_get_pixbuf_completed)
+
