xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikitin, Dimitry" <dimitry.niki...@tfn.com>
Subject Batik 1.1.1 - ImageTranscoder.java - bug?
Date Wed, 14 Aug 2002 14:19:35 GMT
It seems there's a bug in ImageTranscoder.java v.1.1.1. It's fixes in
1.5beta3 but I still thought it was worth pointing out. I'm sorry if it's a
known bug; I couldn't find anything on this in archives.

If KEY_BACKGROUND_COLOR hint is specified then g2d object is disposed of
before the actual image is drawn; this causes image to be blank. When using
the rasterizer app with image/jpeg format the image is always blank because
KEY_BACKGROUND_COLOR is set in JPEGTranscoder constructor.

            if (hints.containsKey(KEY_BACKGROUND_COLOR)) {
                Paint bgcolor = (Paint)hints.get(KEY_BACKGROUND_COLOR);
                g2d.setComposite(AlphaComposite.SrcOver);
                g2d.setPaint(bgcolor);
                g2d.fillRect(0, 0, w, h);
>              g2d.dispose(); // bug
            }
            if (rend != null) { // might be null if the svg document is
empty
                g2d.drawRenderedImage(rend, new AffineTransform());
            }
>>        g2d.dispose();// dispose should be here



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


Mime
View raw message