From de168bab7e106145043a245c5f12649e7f2abd00 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Thu, 5 Feb 2015 19:46:30 +0100 Subject: [PATCH] Use transparent rather than white background for ImageMagick SVG thumbnails Default value of $wgSVGConverters['ImageMagick'] now uses transparent background with white fallback color, rather than just white background. This is done by using #ffffff00 ("transparent white") as background color (the PNG file format supports saving color for transparent pixels). I could find no historical records for why it was done this way; possibly the intent was to display white rather than black background in IE 6 (which doesn't support PNG transparency) or in other contexts where transparent background is impossible. Bug: T76475 Change-Id: Ief0c7d71c8cc157e256fc84b1b7be3c23cc5fd9b --- RELEASE-NOTES-1.25 | 2 ++ includes/DefaultSettings.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25 index dfcd177bcb..a864025bf0 100644 --- a/RELEASE-NOTES-1.25 +++ b/RELEASE-NOTES-1.25 @@ -38,6 +38,8 @@ production. for zend/hhvm. Also, for hhvm, one can consider using its xenon profiler. * Default value of $wgSVGConverters['rsvg'] now uses the 'rsvg-convert' binary rather than 'rsvg'. +* Default value of $wgSVGConverters['ImageMagick'] now uses transparent + background with white fallback color, rather than just white background. === New features in 1.25 === * (T64861) Updated plural rules to CLDR 26. Includes incompatible changes diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index db3c0e27c8..82011fe3b8 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -951,7 +951,7 @@ $wgExiv2Command = '/usr/bin/exiv2'; * are passed as parameters after $srcPath, $dstPath, $width, $height */ $wgSVGConverters = array( - 'ImageMagick' => '$path/convert -background white -thumbnail $widthx$height\! $input PNG:$output', + 'ImageMagick' => '$path/convert -background "#ffffff00" -thumbnail $widthx$height\! $input PNG:$output', 'sodipodi' => '$path/sodipodi -z -w $width -f $input -e $output', 'inkscape' => '$path/inkscape -z -w $width -f $input -e $output', 'batik' => 'java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d ' -- 2.20.1