Mime-Detective icon indicating copy to clipboard operation
Mime-Detective copied to clipboard

Support svg

Open guylando opened this issue 6 years ago • 1 comments

can you please add support to sniff svg? thats the only thing missing to use this package for image content format sniffing.

guylando avatar Jul 08 '18 15:07 guylando

A few things need to be pointed out here; this library is binary file focused and SVG is an XML text file and may be subject to variations. For example, the XML and doctype heading presence and content will vary, since Mime-Type expects a specific byte block match at a specific location, it may fail to recognize SVG sometimes.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 1200 1200" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">

RobertoMachorro avatar Dec 12 '18 16:12 RobertoMachorro