Use transparent rather than white background for ImageMagick SVG thumbnails
authorBartosz Dziewoński <matma.rex@gmail.com>
Thu, 5 Feb 2015 18:46:30 +0000 (19:46 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Thu, 5 Feb 2015 19:23:34 +0000 (19:23 +0000)
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
includes/DefaultSettings.php

index dfcd177..a864025 100644 (file)
@@ -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
index db3c0e2..82011fe 100644 (file)
@@ -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 '