SVG image is recognized as XML and thus is not considered "an image"
dko-slapdash opened this issue · 2 comments
The library could've done something custom for SVGs (since it's anyway coupled to the images), like detecting an <svg>
tag inside the file content or so.
From the readme:
SVG isn't included as it requires the whole file to be read, but you can get it here.
SVG support is not built-in as it's not 100% reliable.
Well, nothing is 100% reliable, because the underlying library just checks for the file signature. It doesn’t verify that the file content is actually an image. It doesn’t matter what’s in readme, what matters is the actual useful functionality.
Not having svg support here made me uninstall this library and write my own stuff on top of file-type. This is what makes the libraries useful - to have them the users’ needs covered.