[cairo] [SVG] a8-mask failure

Carl Worth cworth at cworth.org
Thu Mar 20 16:32:03 PDT 2008

On Thu, 20 Mar 2008 18:50:43 +0100, Emmanuel Pacaud wrote:
> 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 ?

Here's the commit that gave us the upgrade of libpng warnings into

commit c06d929325710c1a2cbecb8a64803ca8e1ffbec0
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Feb 28 16:07:57 2008 +0000

    [cairo-png] Further hardening against malloc failures.

    On some OOM paths, libpng raises a warning as opposed to an error,
    these were not being propagated back to the caller. We were also not
    checking that we did not overwrite a pre-existing error status when
    raising an error whilst performing I/O.

That sounds like there are bugs in libpng where it's returning a
warning though it should be returning an error. And the workaround for
this is causing the problematic behavior for a8-mask with cairo-svg.

If nothing else, we've got a single commit to revert if really

> And more important, does someone here know how to fix the warning ?

But yes, this is the most important part. Let's try to get this fixed
so we can avoid these warning-handling code paths entirely. (But no, I
don't have any idea yet what needs to be changed here.)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080320/747f2fc0/attachment.pgp 

More information about the cairo mailing list