Page MenuHomePhabricator

librsvg workaround for black background on Firefox printing
Closed, DeclinedPublic

Description

As described on [[Wikipedia:Village pump (technical)#Black background]], when
printing the PNG file generated from a SVG image on Firefox 1.5, the transparent
areas show as black instead of the expected color. While this is a bug on
Firefox (it's ignoring the alpha channel), a workaround would be useful. The
attached patch to librsvg-2.11.1 is a quick and dirty hack to change the default
color of the image from fully transparent black to fully transparent white, with
the result that, when printing on Firefox, the transparent areas of the image
show as white.


Version: unspecified
Severity: normal
OS: Linux
Platform: PC
URL: http://en.wikipedia.org/wiki/Wikipedia:Village_pump_%28technical%29#Black_background

Details

Reference
bz4968

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 9:05 PM
bzimport set Reference to bz4968.

Created attachment 1385
Patch to librsvg-2.11.1 to change the default color from transparent black to transparent white

rsvg-art-render.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletion(-)

Attached:

Note: lightly tested (only with [[Image:Mitochondrie.svg]]). Assumes
non-negative width.

The current rendered image prints fine from Firefox 1.5.0.1 on Mac OS X.

Is this specific to Linux printing? My PC's being used this weekend so
I can't test it for a couple days...

It was originally reported on Windows Firefox 1.5, and I reproduced it on Linux
Firefox 1.5 (in fact 1.5.0.1). I guess the printing code is different for each
platform (Windows probably has to use GDI, while on Linux it directly generates
Postscript).

Confirmed on Linux and Windows. Maybe everyone should upgrade to a Mac. ;)
Off to test patches and updated rsvg...

Output from patched librsvg seems to work for Firefox on Linux, but not on Windows.
(Tested with generic .ps output on Linux and saved output from LaserJet 4MP driver
on Windows XP, as I can't figure out how to get my PC and my Mac to talk to each
other regarding printers. Bleah!)

The upstream developer has marked our feature request as WONTFIX. I suggest we
continue to maintain our patch.

*** Bug 12442 has been marked as a duplicate of this bug. ***

On Firefox 3 the bug has been fixed.

mark.g.stewart wrote:

This also occurs on Firefox 2.0.0.11 on Windows XP Media Edition (similar to XP Professional).

Assigning SVG bugs to Ariel -- need a cleanup pass to see what's fixed up by a librsvg upgrade, what can be resolved with fixes to our font configuration, what can be fixed on our end, and what still needs to be pushed upstream.

According to Platonides this is fixed in Firefox 3. I don't see why we should keep this open any longer. Not much we can do here.