I had been getting an odd NullPointerException when calling SVGGraphics2D.drawRenderedImage, so I built the library from source to get more debugging information, and the problem simply went away. I tried recompiling with the debug flag off, and still couldn't reproduce the problem. I think there might be a problem with the JARs being hosted in maven central.
I put together a small GitHub repo to reproduce the problem: https://github.com/SkioDev/batik-debug This generates this stacktrace: Exception in thread "main" java.lang.NullPointerException at org.apache.batik.svggen.ImageHandlerBase64Encoder.encodeImage(Unknown Source) at org.apache.batik.svggen.ImageHandlerBase64Encoder.handleHREF(Unknown Source) at org.apache.batik.svggen.DefaultImageHandler.handleImage(Unknown Source) at org.apache.batik.svggen.SimpleImageHandler.handleImage(Unknown Source) at org.apache.batik.svggen.SVGGraphics2D.drawRenderedImage(Unknown Source) at com.skio.batik_debug.App.main(App.java:44) Environment details: OS: Mac OS X El Capitan Version 10.11.3 JDK: Java(TM) SE Runtime Environment (build 1.8.0_40-b25) -- Cameron Mullen Founder & CEO - Skio +1 (214) 232-5010 [email protected]
