bojand / infer

Small crate to infer file and MIME type by checking the magic number signature
MIT License
279 stars 26 forks source link

Add partial support for SVG #73

Open qarmin opened 2 years ago

qarmin commented 2 years ago

Closes https://github.com/bojand/infer/issues/60

This add partial support for SVG. Most of SVG files which I checked started with <svg

<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">

but some starts with:

<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1604130777424" class="icon"

which makes it impossible to simply search for an SVG file