Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path parsing error #26

Closed
egrimate opened this issue Jan 18, 2021 · 2 comments
Closed

Path parsing error #26

egrimate opened this issue Jan 18, 2021 · 2 comments
Assignees

Comments

@egrimate
Copy link
Contributor

egrimate commented Jan 18, 2021

The following example results in the error below. This example errors on input string "L", but I have additional examples the error on input string "q".

SVG Input File

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 777.14 754.49">
  <defs>
    <style>.cls-1{fill:#ef5024;}</style>
  </defs>
  <title>IP Address</title>
  <g id="Layer_2" data-name="Layer 2">
    <g id="Miscellaneous">
      <g id="IP_Address" data-name="IP Address">
        <path class="cls-1" d="M672.55,754.49H104.66C47.07,754.49.11,707.55,0,649.88L.09,104.66A104.77,104.77,0,0,1,104.71,0L672.55,0h.1A104.61,104.61,0,0,1,777.14,104.66V328.22a21.37,21.37,0,1,1-42.73,0V104.66a61.83,61.83,0,0,0-61.78-61.89h-.07l-567.85,0a62,62,0,0,0-61.88,61.92l-.09,545.17a62.09,62.09,0,0,0,61.92,61.93H672.55a61.85,61.85,0,0,0,61.86-61.91V479.4a21.37,21.37,0,1,1,42.73,0V649.83A104.58,104.58,0,0,1,672.55,754.49Z"/>
        <path class="cls-1" d="M294.84,450.7V269.09h38.51V450.7Z"/>
        <path class="cls-1" d="M513.43,325.73q0,29.32-18.32,44.85T443,386.11H426.48V450.7H388V269.09h58q33,0,50.25,14.22T513.43,325.73Zm-86.95,28.82h12.67q17.76,0,26.58-7t8.82-20.44q0-13.55-7.39-20T444,300.64H426.48Z"/>
      </g>
    </g>
  </g>
</svg>

Error Message
java.lang.NumberFormatException: For input string: "L"
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
at java.lang.Double.parseDouble(Double.java:538)
at java.lang.Double.valueOf(Double.java:502)
at com.mxgraph.svg2xml.Shape2Xml.getPathParam(Shape2Xml.java:1564)
at com.mxgraph.svg2xml.mxPathParser.curvetoQuadraticSmoothAbs(mxPathParser.java:423)
at com.mxgraph.svg2xml.mxPathParser.createShape(mxPathParser.java:154)
at com.mxgraph.svg2xml.Shape2Xml.parse(Shape2Xml.java:354)
at com.mxgraph.svg2xml.Svg2Xml.(Svg2Xml.java:510)
at com.mxgraph.svg2xml.Svg2XmlGui.actionPerformed(Svg2XmlGui.java:253)

Original post:
https://groups.google.com/g/drawio/c/J84VkEIxIFQ

@egrimate egrimate self-assigned this Jan 18, 2021
@tbouffard
Copy link

The exception stack seems closed to #2

@egrimate
Copy link
Contributor Author

egrimate commented Feb 9, 2021

Fixed

@egrimate egrimate closed this as completed Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants