[ 
https://issues.apache.org/jira/browse/BATIK-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15932263#comment-15932263
 ] 

Hussein Shafie commented on BATIK-1090:
---------------------------------------

Simon,

With my patch, Batik 1.8 has no problem rasterizing 
https://www.dropbox.com/s/yx06wrzwx7y5eih/outer.svg?dl=0 . I tested that this 
morning.

I'm not a Batik commiter but just a Batik user like you, that's why you'll not 
find my patch in the night builds.




> Embedded SVG reports "Content is not allowed in prolog"
> -------------------------------------------------------
>
>                 Key: BATIK-1090
>                 URL: https://issues.apache.org/jira/browse/BATIK-1090
>             Project: Batik
>          Issue Type: Bug
>          Components: Bridge, SVG Rasterizer
>    Affects Versions: 1.7, 1.8
>         Environment: Both Ubuntu and OS X Yosemite
>            Reporter: Simon Sotak
>         Attachments: inner.svg, outer.svg, ParsedURLDataProtocolHandler.patch
>
>
> I have the following svg:
> https://www.dropbox.com/s/yx06wrzwx7y5eih/outer.svg?dl=0
> When I try to rasterize it with Batik, I get the exception
> {code:borderStyle=solid}
> org.apache.batik.bridge.BridgeException: Content is not allowed in prolog.
>       at 
> org.apache.batik.bridge.BridgeContext.getReferencedNode(BridgeContext.java:780)
>       at 
> org.apache.batik.bridge.BridgeContext.getReferencedElement(BridgeContext.java:796)
>       at 
> org.apache.batik.bridge.CSSUtilities.convertClipPath(CSSUtilities.java:719)
>       at 
> org.apache.batik.bridge.AbstractGraphicsNodeBridge.buildGraphicsNode(AbstractGraphicsNodeBridge.java:146)
>       at 
> org.apache.batik.bridge.SVGShapeElementBridge.buildGraphicsNode(SVGShapeElementBridge.java:92)
>       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.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:141)
>       at 
> org.apache.batik.bridge.SVGImageElementBridge.createSVGImageNode(SVGImageElementBridge.java:660)
>       at 
> org.apache.batik.bridge.SVGImageElementBridge.createImageGraphicsNode(SVGImageElementBridge.java:288)
>       at 
> org.apache.batik.bridge.SVGImageElementBridge.buildImageGraphicsNode(SVGImageElementBridge.java:177)
>       at 
> org.apache.batik.bridge.SVGImageElementBridge.createGraphicsNode(SVGImageElementBridge.java:119)
>       at 
> org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:213)
>       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 <my_code>
> Exception in thread "Animation Thread" 
> org.apache.batik.transcoder.TranscoderException: null
> Enclosed Exception:
> Content is not allowed in prolog.
>       at 
> org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:227)
>       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 <my_code>
> {code}
> I tried decoding the embedded base64 SVG, and batik rasterized it correctly.
> Here it is: https://dl.dropboxusercontent.com/u/73774/svg/inner.svg
> I tried inspecting the issue a bit, and the problem seems to be that the URLs 
> in the embedded SVG that are in the form {{url(#SVGID_6_)}} are transformed 
> to the form {{data:,#SVGID_6_}} which seems to cause the problem.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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

Reply via email to