cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 6775] New: - [PATCH] Re-Enabling generating JPEGs under JDK1.4.0/Cocoon
Date Fri, 01 Mar 2002 02:28:24 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6775>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6775

[PATCH] Re-Enabling generating JPEGs under JDK1.4.0/Cocoon

           Summary: [PATCH] Re-Enabling generating JPEGs under
                    JDK1.4.0/Cocoon
           Product: Batik 1.0
           Version: 1.1.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: SVG Rasterizer
        AssignedTo: tkormann@apache.org
        ReportedBy: mhartle@hartle-klug.com
                CC: cocoon-dev@xml.apache.org


If you are using JDK1.4.0, use the JPEGTranscoder and have set the hint
ImageTranscoder.KEY_BACKGROUND_COLOR (like the Cocoon SVGSerializer presetting
white as background color), you receive a blank image with the hinted background
color you set instead of the image you wanted.

This is produced due to the single, misplaced g2d.dispose()-call - according to
the Javadoc, g2d.dispose() releases all related system resources and makes the
Graphics2D unusable, but currently, after disposing g2d, it is being used by
painting the image on it. Seems like the JDK1.4.0 has some changes under the
hood that now enforce the spec.

Cut the g2d.dispose()-call out of the if-statement checking for the
ImageTranscoder.KEY_BACKGROUND_COLOR hint and move it further down, paste it
into a new line directly before "rend = null;".

Making this change to batik, rebuilding libs-jar and replacing the default batik
jar in Cocoon, it suddenly serializes SVG to JPEGs under JDK1.4.0 again like a
charm.

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message