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

Eric McIntyre commented on BATIK-1367:
--------------------------------------

I received some helpful information from [~peterhull90] on the mailing list:
{quote}Alright I might have found something.
In your 'bar.svg', line 92 has:
    {{<path d="M531.1467011718751,517.4706589889436}}
{{L658.3522441406251,517.4706589889436 L658.3522441406251,536.894375}}
{{L531.1467011718751,536.894375 Z L-1.7976931348623157E308,536.894375 Z"}}
{{style="fill:rgb(0,115,157);stroke:none;"/>}}

The path ends with "Z L...,... Z" which I think is not great: Z closes
the path and then draws one more Line and then closes the path again.
However Batik is OK with that, the actual problem is the x-coord of
that last line which is -1.7976931348623157E308 i.e. a very large
negative number.

I have made this minimal SVG which Batik also renders as a completely
black image. Edge browser shows a blue square.

{{<svg height="750px" version="1.1" viewBox="0 0 700 750" width="700px"}}
{{x="0px" y="0px" 
xmlns="[http://www.w3.org/2000/svg|https://urldefense.com/v3/__http://www.w3.org/2000/svg__;!!NpxR!lbsn10vUqAEvk6KNI8PlFwegv5lPOXb6qPnlrrUlXySXSxjnwx3d6nRBGJFH269k9Piu-1DdmXeS-PVEa4ZIhQkBUg$]";>}}
{{    <path d="M100,100 H600 V600 H100 Z L-1e308,0 Z"}}
{{style="fill:rgb(0,115,157);stroke:none;"/>}}
{{</svg>}}

I don't know what the SVG spec says about the allowed range of
numbers, so maybe this is invalid SVG, but it seems to me that Batik
could handle this better.
{quote}
And then Thomas DeWeese sent some info from the SVG spec:
{quote}
h2. 
[https://www.w3.org/TR/SVG11/types.html#BasicDataTypes|https://urldefense.com/v3/__https://www.w3.org/TR/SVG11/types.html*BasicDataTypes__;Iw!!NpxR!lbsn10vUqAEvk6KNI8PlFwegv5lPOXb6qPnlrrUlXySXSxjnwx3d6nRBGJFH269k9Piu-1DdmXeS-PVEa4Z3QZTZwA$]
h2. {color:#005a9c}4.3 Real number precision{color}

Unless stated otherwise for a particular attribute or 
[property|https://urldefense.com/v3/__https://www.w3.org/TR/SVG11/intro.html*TermProperty__;Iw!!NpxR!lbsn10vUqAEvk6KNI8PlFwegv5lPOXb6qPnlrrUlXySXSxjnwx3d6nRBGJFH269k9Piu-1DdmXeS-PVEa4bXjjhhHg$],
 a 
[<number>|https://urldefense.com/v3/__https://www.w3.org/TR/SVG11/types.html*DataTypeNumber__;Iw!!NpxR!lbsn10vUqAEvk6KNI8PlFwegv5lPOXb6qPnlrrUlXySXSxjnwx3d6nRBGJFH269k9Piu-1DdmXeS-PVEa4Z73D2IOA$]
 has the capacity for at least a single-precision floating point number and has 
a range (at a minimum) of -3.4e+38F to +3.4e+38F.
{quote}

> Bar charts generated by XChart cannot be rasterized by Batik
> ------------------------------------------------------------
>
>                 Key: BATIK-1367
>                 URL: https://issues.apache.org/jira/browse/BATIK-1367
>             Project: Batik
>          Issue Type: Bug
>          Components: SVG Rasterizer
>    Affects Versions: 1.17
>         Environment: macOS 14.4.1/M1 Max/OpenJDK 21.0.1+12-LTS 
> (Zulu21.30+15-CA)
> Linux 5.15.0-1044-aws/amd64/OpenJDK 11.0.18 (Eclipse Adoptium OpenJDK 64-Bit 
> Server VM 11.0.18+10)
>            Reporter: Eric McIntyre
>            Priority: Major
>         Attachments: png.zip, svg.zip
>
>
> We have a process to generate SVG charts using XChart, which are then 
> embedded in an HTML document and rendered as PDFs using Flying Saucer. Batik 
> is plugged into the pipeline to render the SVGs.
> We've found that the bar charts created by XChart are not properly rasterized 
> by Batik, even though they can be rendered within Chrome, Firefox, Inkscape, 
> and other SVG-capable software. I was able to duplicate the issue using the 
> standalone Batik Rasterizer program.
> The attached {{svg.zip}} file contains a sampling of SVGs generated with 
> XChart. The {{png.zip}} file contains the results of running {{{}java -jar 
> batik-rasterizer-1.17.jar -d ./*.svg{}}}. You can see that all of the bar 
> charts are rendered as empty (transparent?) 700x750 PNGs, whereas the line & 
> pie charts are rendered correctly. This seems to be a bug, though it's 
> possible that the SVGs in question use a feature that is not currently 
> supported by Batik.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
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