https://issues.apache.org/bugzilla/show_bug.cgi?id=46825

           Summary: Error while trying to convert linearGradient element
                    in SVG
           Product: Batik
           Version: 1.7
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: Bridge
        AssignedTo: [email protected]
        ReportedBy: [email protected]


I try to convert an SVG image to PNG.

I use two images : one which does not contain linearGradient and the other one
which does. When I try to convert the one with linearGradient I get an error.

Here is the SGV code for the image :

    <g>
        <g id="texte_ecolo_4_">
            <text transform="matrix(1 0 0 1 27.9604 151.0898)" fill="#75AF43"
font-family="'Tahoma'" font-size="6">S.V.P., pensez à l’environnement avant
d’imprimer ce message.</text>
        </g>
        <g id="logo_ecolo_4_">
            <linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse"
x1="2.1069" y1="149.5684" x2="23.0229" y2="149.5684">
                <stop  offset="0" style="stop-color:#145A2D"/>
                <stop  offset="0.0763" style="stop-color:#346E34"/>
                <stop  offset="0.1923" style="stop-color:#55893A"/>
                <stop  offset="0.3165" style="stop-color:#6FA03E"/>
                <stop  offset="0.4511" style="stop-color:#82B340"/>
                <stop  offset="0.6038" style="stop-color:#8FC041"/>
                <stop  offset="0.8132" style="stop-color:#94C641"/>
                <stop  offset="1" style="stop-color:#75AF43"/>
            </linearGradient>
            <path fill="url(#SVGID_1_)"
d="M2.107,148.518c0.837-0.387,2.13-1.053,2.709-1.053c0,0,0.258,9.715,18.207,7.912
               
c0,0-3.896-1.82-5.469-6.561c-1.855-5.598-9.123-6.65-11.26-3.604l-1.735,0.771c0,0,4.538-1.516,7.978,1.285
               
c2.674,2.178,3.495,4.383,5.77,6.463c-1.747-1.332-2.386-2.219-4.715-4.688c-2.331-2.469-5.942-4.033-11.349-1.387L2.107,148.518
                z"/>
            <linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse"
x1="6.0151" y1="151.4512" x2="19.9136" y2="151.4512">
                <stop  offset="0" style="stop-color:#AAD26B"/>
                <stop  offset="0.1703" style="stop-color:#FFFFFF"/>
                <stop  offset="1" style="stop-color:#AAD26B"/>
            </linearGradient>
            <path fill="url(#SVGID_2_)"
d="M6.015,147.75c0.798,6.477,8.751,7.879,13.898,7.273C19.914,155.023,8.071,155.459,6.015,147.75z"
                />
            <linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse"
x1="6.9106" y1="147.6875" x2="17.7378" y2="147.6875">
                <stop  offset="0" style="stop-color:#AAD26B"/>
                <stop  offset="0.3297" style="stop-color:#FFFFFF"/>
                <stop  offset="1" style="stop-color:#AAD26B"/>
            </linearGradient>
            <path fill="url(#SVGID_3_)"
d="M6.911,145.139c4.108-2.297,8.507-0.605,10.827,6.066c0,0-1.909-4.326-5.124-5.922
                C10.172,144.07,6.911,145.139,6.911,145.139z"/>
        </g>
    </g>

And this is the error I get:

org.apache.batik.bridge.BridgeContext.getReferencedNode(BridgeContext.java:780)
    at
org.apache.batik.bridge.BridgeContext.getReferencedElement(BridgeContext.java:796)
    at
org.apache.batik.bridge.PaintServer.convertURIPaint(PaintServer.java:351)
    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.buildGraphicsNode(GVTBuilder.java:219)
    at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)
    at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:82)

Since the same code work in the same situation with another SVG file, I assume
there is a problem in the Batik code that should be fixed.

If you need more information do not hesitate.

Thanks,

Sébastien

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to