Use ImageMagick's -background parameter to set the background color of
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 9 Aug 2004 01:59:40 +0000 (01:59 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 9 Aug 2004 01:59:40 +0000 (01:59 +0000)
transparent PNG thumbnails to white instead of default black. This will
be shown in Internet Explorer 6 and will generally be less invasive
(particularly for black-on-transparent line art!)

Fix for [ 978664 ] Thumbnails of transparent PNGs bad in IE6

includes/Image.php

index e5b306e..29f6d86 100644 (file)
@@ -162,8 +162,10 @@ class Image
                if ( (! file_exists( $thumbPath ) ) || ( filemtime($thumbPath) < filemtime($this->imagePath) ) ) {
                        if ( $wgUseImageMagick ) {
                                # use ImageMagick
+                               # Specify white background color, will be used for transparent images
+                               # in Internet Explorer/Windows instead of default black.
                                $cmd  =  $wgImageMagickConvertCommand .
-                                       " -quality 85 -geometry {$width} ".
+                                       " -quality 85 -background white -geometry {$width} ".
                                        escapeshellarg($this->imagePath) . " " .
                                        escapeshellarg($thumbPath);
                                $conv = shell_exec( $cmd );