diff --git a/scour/scour.py b/scour/scour.py index 010f686..f72e459 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -2877,6 +2877,10 @@ def scourString(in_string, options=None): global numBytesSavedInTransforms doc = xml.dom.minidom.parseString(in_string) + # remove if the user wants to + if options.remove_metadata: + removeMetadataElements(doc) + # for whatever reason this does not always remove all inkscape/sodipodi attributes/elements # on the first pass, so we do it multiple times # does it have to do with removal of children affecting the childlist? @@ -2947,10 +2951,6 @@ def scourString(in_string, options=None): if options.simple_colors: numBytesSavedInColors = convertColors(doc.documentElement) - # remove if the user wants to - if options.remove_metadata: - removeMetadataElements(doc) - # remove unreferenced gradients/patterns outside of defs # and most unreferenced elements inside of defs while removeUnreferencedElements(doc, options.keep_defs) > 0: