Skip to content

SVG path parse error #421

@dfung

Description

@dfung

CairoSVG generates an error when calling svg2png for this simple svg example:

<svg xmlns="http://www.w3.org/2000/svg" width="556.76" height="1080" viewBox="0 0 556.76 1080">
<path d="M364.75 477.76c-4.36.0-6.89 3.37-7.35 7.35a2e2 2e2.0 0 0-.92 23c0 9.48 14.7 9.48 14.7.0a2e2 2e2.0 0 1 .92-23C372.56 481.12 368.41 477.76 364.75 477.76z" />
</svg>

I think the issue is with the point() helper function which does not fully match up with the number definition in the SVG specification.

The point() function fails to decode this string "2e2 2e2.0 0 0-.92 23" as (2e2, 2e2, '.0 0 0-.92 23') but instead returns (2e2, 2e2.0, '0 0-.92 23'). The SVG spec does not appear to allow decimals in the exponent value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions