-
Notifications
You must be signed in to change notification settings - Fork 93
Do not remove metadata when --remove-metadata=no #214
Comments
@jgneff You should try
@RazrFalcon |
Thank you, @JoKalliauer. Now I get it. I didn't realize that the options were independent. I can understand how that might be useful, but the downside is that you then kind of need to understand all of the options to get it right, and there are a lot of them. svgcleaner is a great tool, regardless. I ended up just letting svgcleaner remove the metadata, and I add it with sed afterwards, as shown below. ~/opt/svgcleaner-0.9.5/svgcleaner --indent=0 tmp/file.svg tmp/file-clean.svg
sed -e "/<svg/r tmp/metadata.xml" \
-e '1 i <?xml version="1.0" encoding="UTF-8"?>' \
-e "s/Arimo/Arimo,Liberation Sans,Arial,sans-serif/g" tmp/file-clean.svg \
> out/file.svg As you can see, I also add an XML declaration because of a bug in my old copy of ExifTool 10.10 (fixed in version 11.66), and I add a full font stack. By the way, this font stack works great with very good metric compatibility across systems. The only one that is slightly off is Android, which has no Arial-compatible font and uses Roboto for the sans-serif, but it's good enough and not worth converting the text to paths. |
svgcleaner removes the content of the
metadata
element even when the option--remove-metadata
is set tono
.The input file is the example from the documentation:
input.svg:
Removing the metadata works fine:
remove-metadata-yes.svg:
Yet even when
--remove-metadata=no
, svgcleaner removes the content of themetadata
element, leaving an empty element in its place:remove-metadata-no.svg:
I would like the final output file to contain my metadata for a Creative Commons license.
The text was updated successfully, but these errors were encountered: