Broken inline SVG support for Quadratic Curves

0 votes
asked Oct 27, 2022 in Bug by Michael (120 points)

Hi Plant UML Support:

I noticed a bug in the inline SVG support. If the SVG path contains any quadratic Bezier curves – rendering of the diagram using the inline SVG as a sprite will fail with the following error:

An error has occurred: java.lang.IllegalArgumentException: Q

See the sample diagram to reproduce:
 

@startuml
sprite SVG_NO_BEZIER <svg width="12cm" height="6cm" viewBox="0 0 1200 600"
     xmlns="http://www.w3.org/2000/svg" version="1.1">
  <path d="M200,300 L400,50 L600,300
           L800,550 L1000,300"
        fill="none" stroke="#888888" stroke-width="2" />
</svg>

sprite SVG_WITH_BEZIER <svg width="12cm" height="6cm" viewBox="0 0 1200 600"
     xmlns="http://www.w3.org/2000/svg" version="1.1">
  <path d="M200,300 Q400,50 600,300 T1000,300"
        fill="none" stroke="red" stroke-width="5"  />
</svg>

Alice->Bob : <$SVG_NO_BEZIER>
' Quadratic Bézier curve commands in path result in "java.lang.IllegalArgumentException: Q" or "java.lang.IllegalArgumentException: q"
Alice->Bob : <$SVG_WITH_BEZIER>

@enduml



The issue does not happen if I use the <img> tag instead – the SVG draws correctly (There is another issue with <img> tag, unfortunately, which prevents me from using it instead of inline SVG sprites - <img> tag does not seem to look for the image files inside the packaged ZIP that I “import”).

Can you please look at it? The attached diagram SVG contains the failure + the original diagram source code at the end.

Thanks,

Michael 

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...