Hi,

please, can you file in a bug entry in Jira at [1], attaching short
test case that will allow dev team to reproduce the issue.

[1] https://issues.apache.org/jira/issues/?jql=project%20%3D%20BATIK

2014-06-23 7:16 GMT+02:00 Amber Fan <mydear...@126.com>:
> Thank you for your greate work batik;
> I'm a java developer and I'm using batik to convert svg code to png file.
> I'm now meeting with a problem. I think it's  a bug of batik;
> below is the code in SVGLinearGradientElementBridge.java:127
> if (bbox != null && bbox.getWidth() == 0 || bbox.getHeight() == 0) {
>                 return null;
> }
> if bbox ==null ,then "bbox.getHeight() == 0" will be executed. And the
> NullPointerException will occor.
>
> please see the svg code  in the attachment and the exception below. That
> file works well in Chrome;
> Sorry I can't make a unit test for you.
>
> batik version: 1.7
> exception:
> Exception in thread "main" java.lang.NullPointerException
> at
> org.apache.batik.bridge.SVGLinearGradientElementBridge.buildGradient(SVGLinearGradientElementBridge.java:127)
> at
> org.apache.batik.bridge.AbstractSVGGradientElementBridge.createPaint(AbstractSVGGradientElementBridge.java:113)
> at org.apache.batik.bridge.PaintServer.convertURIPaint(PaintServer.java:359)
> at org.apache.batik.bridge.PaintServer.convertPaint(PaintServer.java:259)
> at
> org.apache.batik.bridge.PaintServer.convertFillPaint(PaintServer.java:228)
> at
> org.apache.batik.bridge.PaintServer.convertFillAndStroke(PaintServer.java:146)
> at
> org.apache.batik.bridge.SVGShapeElementBridge.createShapePainter(SVGShapeElementBridge.java:117)
> at
> org.apache.batik.bridge.SVGDecoratedShapeElementBridge.createFillStrokePainter(SVGDecoratedShapeElementBridge.java:58)
> at
> org.apache.batik.bridge.SVGDecoratedShapeElementBridge.createShapePainter(SVGDecoratedShapeElementBridge.java:84)
> at
> org.apache.batik.bridge.SVGShapeElementBridge.buildGraphicsNode(SVGShapeElementBridge.java:91)
> at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:224)
> at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)
> at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:219)
> at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)
> at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:219)
> at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)
> at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:82)
> at
> org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:208)
> at
> org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTranscoder.java:92)
> at
> org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:142)
> at
> org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:156)
> at com.hb712.env.common.util.Svg2Png.convertToPng(Svg2Png.java:55)
> at com.hb712.env.common.util.Svg2Png.convertToPng(Svg2Png.java:23)
> at com.hb712.env.test.Test06.test(Test06.java:26)
> at com.hb712.env.test.Test06.main(Test06.java:14)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)



-- 
pascal

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

Reply via email to