Index: includes/Image.php
===================================================================
RCS file: /cvsroot/wikipedia/phase3/includes/Image.php,v
retrieving revision 1.19
diff -u -r1.19 Image.php
--- includes/Image.php	24 Aug 2004 08:11:45 -0000	1.19
+++ includes/Image.php	28 Aug 2004 02:22:09 -0000
@@ -200,14 +200,24 @@
 						break;
 				}
 				$height = floor( $this->height * ( $width/$this->width ) );
-				if ( $truecolor ) {
+				if( $truecolor ) {
 					$dst_image = imagecreatetruecolor( $width, $height );
+					imagealphablending( $dst_image, false );
+					imagesavealpha( $dst_image, true );
+					imagecopyresampled( $dst_image, $src_image, 
+						0,0,0,0,
+						$width, $height, $this->width, $this->height );
 				} else {
-					$dst_image = imagecreate( $width, $height );
+					$cmd = $wgImageMagickConvertCommand .
+						" -quality 85 -geometry {$width} ".
+						escapeshellarg($this->imagePath) . " " .
+						escapeshellarg($thumbPath);
+					$conv = shell_exec( $cmd );
+					$dst_image = imagecreatefrompng( $thumbPath );
+					$tmp_image = imagecreatefrompng( $thumbPath );
+					imagetruecolortopalette( $dst_image, 0, 255 );
+					imagecolormatch( $tmp_image, $dst_image );
 				}
-				imagecopyresampled( $dst_image, $src_image, 
-							0,0,0,0,
-							$width, $height, $this->width, $this->height );
 				switch( $this->type ) {
 					case 1:  # GIF
 					case 3:  # PNG
