[jira] [Updated] (BATIK-1090) Embedded SVG reports "Content is not allowed in prolog"

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jira] [Updated] (BATIK-1090) Embedded SVG reports "Content is not allowed in prolog"

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/BATIK-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simon Sotak updated BATIK-1090:
-------------------------------
    Description:
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.

  was:
I have the following svg:
https://dl.dropboxusercontent.com/u/73774/svg/outer.svg

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.


> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...