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

[enhancement] --remove-metadata removes metadata independend of content (copyright violation) #222

Open
JoKalliauer opened this issue Dec 1, 2018 · 0 comments

Comments

@JoKalliauer
Copy link

I would like a option to only remove empty metadata.

It should delete RDF. RDF subtrees if empty, but it should keep

  • <cc:license>
  • <cc:attributionName>
  • <cc:attributionURL>

Input 1

input1.svg.txt

<svg xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xlink="http://www.w3.org/1999/xlink">
  <metadata id="metadata3879">
    <rdf:RDF>
      <cc:Work rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
</svg>

source: https://de.wikipedia.org/wiki/Benutzer:Marsupilami/Inkscape-FAQ#Wie_erstelle_ich_eine_Datei_die_dem_Standard_SVG_1.1_entspricht?
Author: Marsupilami
Lizense: CC-BY-SA 3.0

Output1 as with --remove-metadata

Output1.svg.txt

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"/>

Input2

input2.svg.txt

<svg
  version="1.1"
  baseProfile="full"
  xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink">

<metadata>
  <rdf:RDF xmlns:cc="http://web.resource.org/cc/"
           xmlns:dc="http://purl.org/dc/elements/1.1/"
           xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <cc:Work rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <cc:license rdf:resource="http://creativecommons.org/licenses/by-sa/3.0/" />
        <cc:attributionName rdf:resource="https://commons.wikimedia.org/wiki/User:Glrx"/>
        <cc:attributionURL rdf:resource="https://commons.wikimedia.org/w/index.php?title=File:SVG_Test_TextAlign.svg"/>
      </cc:Work>
    </rdf:RDF>
  </metadata>
</svg>

source: https://commons.wikimedia.org/w/index.php?title=File:SVG_Test_TextAlign.svg
Author: Glrx
Lizense: CC-BY-SA 3.0

Output2 should keep metadata since it would be a copyright violation

Output2.svg.txt

<?xml version="1.0" encoding="UTF-8"?>
<svg baseProfile="full" version="1.1" xmlns="http://www.w3.org/2000/svg">
 <metadata>
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
   <cc:Work xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <dc:format>image/svg+xml</dc:format>
    <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
    <cc:license rdf:resource="http://creativecommons.org/licenses/by-sa/3.0/"/>
    <cc:attributionName rdf:resource="https://commons.wikimedia.org/wiki/User:Glrx"/>
    <cc:attributionURL rdf:resource="https://commons.wikimedia.org/w/index.php?title=File:SVG_Test_TextAlign.svg"/>
   </cc:Work>
  </rdf:RDF>
 </metadata>
</svg>
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

1 participant