[cairo] [SVG] a8-mask failure
Chris Wilson
chris at chris-wilson.co.uk
Fri Mar 21 00:58:27 PDT 2008
On Thu, 2008-03-20 at 18:50 +0100, Emmanuel Pacaud wrote:
> Hi,
>
> The SVG fails the a8-mask test, because of a libpng warning that is
> converted to a CAIRO_STATUS_NO_MEMORY in png_simple_warning_callback.
>
> The libpng warning is "PNG warning = Ignoring attempt to write bKGD
> chunk out-of-range for bit_depth".
>
> I'm not sure to like the "upgrade" of the warning to a cairo error. And
> the suppression of the PNG warning makes the debugging harder than it
> should.
>
> Do we really want to hide them ? Is there a good reason to make cairo
> fail on something that the libpng developers consider a simple warning ?
On the other hand, no-one even noticed this PNG warning and presumably
cairo's slightly broken PNG generation before we treated the warning as
an error. ;-)
Yes the suppression of the warning does make debugging harder, but as a
library we should not output to a random fd and endeavour to not
generate any console output at all.
Considering that we fail to test all possible paths through write_png()
(at the moment we even do not get full line coverage) it's likely that
there are a full more bugs waiting to be discovered by the unfortunate
user - which will appear to be a regression in 1.6. From this PoV I
think it is probably better to revert c06d92. However some of libpng's
warning are clearly erroneous (the output is truncated, but no error was
raised etc) and maybe we should regard any warnings as a real bug in
cairo's usage of libpng and fix them as they are reported. This is
especially the case of the user has no control how the PNGs are
generated and so write_png() should just work.
Time to see how difficult it is to fix the a8-mask failure case.
--
Chris Wilson
More information about the cairo
mailing list