diff --git a/libmat2/images.py b/libmat2/images.py index 8bef3f8..2781e05 100644 --- a/libmat2/images.py +++ b/libmat2/images.py @@ -37,7 +37,7 @@ class SVGParser(exiftool.ExiftoolParser): def get_meta(self) -> Dict[str, Union[str, dict]]: meta = super().get_meta() - # The namespace is mandatory, but thereis only one bossible. + # The namespace is mandatory, but only the …/2000/svg is valid. ns = 'http://www.w3.org/2000/svg' if meta.get('Xmlns', ns) == ns: meta.pop('Xmlns') diff --git a/tests/data/weird.svg b/tests/data/weird.svg new file mode 100644 index 0000000..b1bd0b4 --- /dev/null +++ b/tests/data/weird.svg @@ -0,0 +1,636 @@ + + + + + + Adwaita Icon Template + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + GNOME Design Team + + + mat2's source code + + Adwaita Icon Template + + + mat2 + logo + metadata + + + 2019 07 13 + + + LGPL + + + + + jvoisin + + + mat2-testdata-svg + + English + + This is a test svg image for mat2's testsuite + + + jvoisin, and Rose for the design + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/test_libmat2.py b/tests/test_libmat2.py index 796d2f1..3fba36a 100644 --- a/tests/test_libmat2.py +++ b/tests/test_libmat2.py @@ -885,4 +885,5 @@ class TestCleaning(unittest.TestCase): os.remove('./tests/data/clean.cleaned.svg') os.remove('./tests/data/clean.cleaned.cleaned.svg') - + p = images.SVGParser('./tests/data/weird.svg') + self.assertEqual(p.get_meta()['Xmlns'], 'http://www.w3.org/1337/svg')