Login Or Sign up

How can I add SPDX licensing info to an SVG file

122 Views Asked by At

Regarding SPDX.

Though doing it with an HTML comment works:

<?xml version="1.0" encoding="UTF-8"?>

<!--
SPDX-FileCopyrightText: 2021 John Doe <[email protected]>

SPDX-License-Identifier: CC-BY-SA-4.0
-->

<svg version="1.2">
...

when editing the file in a GUI editor (e.g. Inkscape) however, the comment is removed after saving. Thus it is not a viable option.

Maybe these could be (ab-)used?:

NOTE

The REUSE tool auto-checks projects for SPDX/licensing conformity, but does not yet support SVG (nor XML specifically). It does support HTML, which is why the HTML comment thing would work, If editors would not strip it.

1

There are 1 best solutions below

0
hakre On

There is metadata in SVG, e.g. here for a description: https://www.w3.org/TR/SVGTiny12/metadata.html .

It also mentions RDF and IIRC SPDX has support for RDF (e.g. https://spdx.org/rdf/spdx-terms-v1.2/terms.html) - or a more current doc: D.4.6 License Expressions in RDF.

Inkscape does not remove the meta-data, even offers an editor for it.