Looks like a double close on an output stream... I believe the solution is to apply the following to org/apache/batik/ext/awt/image/codec/png/PNGImageEncoder.java, although I'd rely on Thomas DeWeese or other committer to verify.
Summary of changes: - removed DeflaterOutputStream.finish() since it is redundant (DeflaterOutputStream.close() is called immediately after and performs the same operation if in a single filter scenario) - removed ios.flush() and ios.close() since DeflaterOutputStream claims to complete the stream write and close the close the underlying stream output of svn diff (I've only commented out the possibly offensive lines) *Index: sources/org/apache/batik/ext/awt/image/codec/png/PNGImageEncoder.java =================================================================== --- sources/org/apache/batik/ext/awt/image/codec/png/PNGImageEncoder.java (revision 938691) +++ sources/org/apache/batik/ext/awt/image/codec/png/PNGImageEncoder.java (working copy) @@ -501,10 +501,10 @@ encodePass(dos, ras, 0, 0, 1, 1); } - dos.finish(); +// dos.finish(); dos.close(); - ios.flush(); - ios.close(); +// ios.flush(); +// ios.close(); } private void writeIEND() throws IOException { * On Tue, May 18, 2010 at 6:56 PM, jonathan wood <jonathanshaww...@gmail.com>wrote: > > This sounds like Bug > 48693<https://issues.apache.org/bugzilla/show_bug.cgi?id=48693>. > Can you review the current bug and verify that is is the same issue? If so, > I may have a bit of time to investigate. > > > > > On Tue, May 18, 2010 at 11:52 AM, IsmAvatar <ismava...@gmail.com> wrote: > >> I guess this is a Bug Report >> >> The subject pretty much explains it all. Using Sun JDK 6u20, and batik >> checked out from the SVN repository, I use Rasterizer (actually >> RasterizerTask, but it calls Rasterizer, and I could reproduce it with >> Rasterizer if desired) on an SVG to generate a PNG. The PNG has 2 additional >> empty IDAT chunks immediately prior to the IEND chunk. These chunks cause >> the PNG to be erroneous (and thus not display) in certain programs, such as >> IE7, as well as Java programs that try to display the image (especially, as >> is my case, if attempting to use it as a Splash Screen). >> >> A sample SVG which may be used to reproduce this problem: >> >> >> http://svn2.xp-dev.com/svn/LateralGM/LateralGM/trunk/org/lateralgm/main/lgm-splash.svg >> >> >> Please do let me know if/when this has been fixed. I use RasterizerTask to >> automate the creation of my splash screen for my program while the program >> is being compiled and built for release, and since Batik's been generating >> these two extra IDAT chunks, my program runs without a splash screen. >> > >