xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marting <oroa...@hotmail.com>
Subject Bug or malformed PNG?
Date Thu, 26 May 2011 13:52:56 GMT
PngImageEncoder in org.apache.batik.ext.awt.image.codec.png is dumping my
attempts to make a SVG file with a RuntimeException (line 886 : public void
encode(RenderedImage im))

A quick dig through the code showed it does this when the channels in a PNG
did not have an equal number of bits -->

            this.bitDepth = sampleSize[0];
            // Ensure all channels have the same bit depth
            for (int i = 1; i < sampleSize.length; i++) {
                if (sampleSize[i] != bitDepth) {
                    throw new RuntimeException();

and interrogating my PNG files showed this was true for a couple of them. I
have a couple of PNGs with 8-bit red/green/blue channels and a 1-bit alpha
channel, equating to what is a transparent bitmasked image (rather than

So my question is has my paint program (Paint.NET on Windows 7) generated a
bad PNG, or is this a bug in batik?

View this message in context: http://batik.2283329.n4.nabble.com/Bug-or-malformed-PNG-tp3552626p3552626.html
Sent from the Batik - Users mailing list archive at Nabble.com.

To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org

View raw message