Index: wp-admin/admin-functions.php
===================================================================
--- wp-admin/admin-functions.php	(revision 3856)
+++ wp-admin/admin-functions.php	(working copy)
@@ -828,6 +828,21 @@
 			}
 
 			$thumbnail = imagecreatetruecolor($image_new_width, $image_new_height);
+
+			if( $type[2] == 3 and function_exists( 'imagealphablending' ) and function_exists( 'imagesavealpha' ) ) {
+				// Preserve PNG transparency, from http://php.net/manual/en/function.imagecopyresampled.php#44134
+				if (function_exists('imageantialias'))
+					imageantialias($thumbnail, TRUE); // not necessary, but not always available
+				imagealphablending($thumbnail, false);
+				imagesavealpha($thumbnail,true);
+				$transparent = imagecolorallocatealpha($thumbnail, 255, 255, 255, 0);
+				for($x=0;$x<$image_new_width;$x++) {
+					for($y=0;$y<$image_new_height;$y++) {
+						imagesetpixel( $thumbnail, $x, $y, $transparent );
+					}
+				}
+			}
+
 			@ imagecopyresampled($thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1]);
 
 			// If no filters change the filename, we'll do a default transformation.
@@ -861,7 +876,7 @@
 	if (!empty ($error)) {
 		return $error;
 	} else {
-		return $thumbpath;
+		return $thumb;
 	}
 }
 
