cdgriffith / puremagic

Pure python implementation of identifying files based off their magic numbers
MIT License
161 stars 34 forks source link

SVG images not recogniced #37

Closed Estartu closed 2 years ago

Estartu commented 2 years ago

SVG images return mime_type='video/x-ms-asf'

cdgriffith commented 2 years ago

Thanks for the heads up! SVG was missing entirely, and probably because most regular magic number indexes don't include it as it's variable (it's just an XML file.)

I have include the lookup for three common places I have seen it. If you happen to come across one that doesn't match, please open the file in a text editor and just reply to this thrad with the part up to <svg.

For example one I found was:

<?xml version="1.0" standalone="yes"?>
<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1">
<path style="fill:#ffffff; stroke:none;" d="M0 0L1 1L0 0z"/>
</svg>

Would just need:

<?xml version="1.0" standalone="yes"?>
<svg 

And of course now thinking about it probably just easier to add a footer lookup for </svg>, but maybe will add that in next release if this one starts becoming a headache :)

Added in 1.12