View Issue Details

IDProjectCategoryView StatusLast Update
0000108fileGeneralpublic2019-09-30 15:45
Reporterizhidkov Assigned Tochristos  
PrioritynormalSeveritytrivialReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.37 
Fixed in Version5.38 
Summary0000108: Incorrect mime type for sgml/svg
DescriptionSVG spec v1.1 and v1.2 both describe SVG mime type only as 'image/svg+xml', there is no option without '+xml'
link to spec v1.1 https://www.w3.org/TR/SVG11/mimereg.html
link to spec v1.2 https://www.w3.org/TR/SVGTiny12/mimereg.html

magic/Magdir/sgml:13 describe it as 'image/svg' which is incorrect according to spec
Steps To ReproduceTry to detect mime type of text file with content(also attached as file):
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 30 30" version="1.1" viewBox="0 0 30 30" style="zoom: 1;" width="240(null)" height="240(null)"><rect x="-1.997164px" y="-6.79887px" width="800px" fill="#303860" height="800px"></rect><g fill="#fff"><path d="M25.5,4.4 c1.6,-0.6 2.9,-0.1 3,0 c-0.1,0 -1.3,0.2 -2.3,1.3 s-1.9,2.7 -2.4,3.4 c-1.4,2 -2.7,2.8 -4.3,3.2 c-2,0.5 -3.2,-0.6 -3.3,-0.7 c0.1,0 1.3,0.3 2.4,-0.5 c1.1,-0.7 2.3,-2.3 3.1,-3.4 c1.2,-1.6 2.4,-2.7 3.8,-3.3 m-22.4,2.8 c-1.4,-1.1 -1.6,-2.6 -1.6,-2.6 s0.8,1.1 2.3,1.3 c1.5,0.3 3.3,0.3 4.2,0.4 c2.5,0.2 3.8,1 4.9,2.2 c1.4,1.5 1,3.1 1.1,3.2 c0,-0.1 -0.4,-1.2 -1.6,-1.8 s-3.1,-0.8 -4.5,-1 c-2.1,-0.3 -3.7,-0.8 -4.8,-1.7 m13.6,18 c-0.2,1.7 -1.4,2.5 -1.4,2.6 c0,-0.1 0.5,-1.2 0,-2.6 s-1.4,-3 -1.8,-3.8 c-1.1,-2.2 -1,-3.7 -0.6,-5.3 c0.6,-2 2.2,-2.4 2.2,-2.5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.9 0.6 1.5 0.6 0.7 1.7 1.2 2.6 1.6 1.2 0.6 2.1 1.2 2.6 2.1 0.6 1 0.4 1.9 0.4 1.9s-0.2-0.8-1.1-1.3c-0.8-0.5-2-0.9-2.5-1.2-1.5-0.7-2.1-1.5-2.5-2.4-0.7-1.3-0.1-2.2-0.1-2.2"></path><path d="m15.7 11.2c0.1 0 1-0.2 1.7-1 0.7-0.9 1.1-2.4 1.4-3.5 0.5-1.6 1.1-2.8 2-3.6 1.1-0.9 2.3-0.8 2.2-0.9 0 0-0.9 0.5-1.3 1.6-0.5 1.2-0.7 2.7-0.9 3.3-0.5 1.9-1.3 2.9-2.4 3.6-1.4 1-2.6 0.5-2.7 0.5"></path><path d="m13.8 12.3c-0.1-0.1-0.7-0.8-1.7-0.9-1.1-0.2-2.6 0.2-3.7 0.5-1.6 0.4-3 0.5-4.1 0.1-1.3-0.4-1.9-1.5-1.9-1.5s0.9 0.6 2.1 0.3c1.2-0.2 2.6-0.7 3.3-0.9 1.9-0.5 3.1-0.3 4.3 0.3 1.5 0.7 1.7 2 1.7 2.1"></path><path d="m15.7 13.4c0 0.1-0.4 1 0 2s1.5 2.1 2.3 3c1.1 1.2 1.9 2.3 2.1 3.5 0.3 1.3-0.3 2.3-0.4 2.4 0-0.1 0-1.1-0.8-2-0.8-1-1.9-1.9-2.4-2.4-1.4-1.4-1.8-2.6-1.9-3.9 0-1.7 1.1-2.5 1.1-2.6"></path></g></svg>
Additional InformationPatch (also attached as file):
--- a/file/magic/Magdir/sgml
+++ b/file/magic/Magdir/sgml
@@ -10,7 +10,7 @@
 >>19 search/4096 \<gnc-v2 GnuCash file
 !:mime application/x-gnucash
 0 string \<svg SVG Scalable Vector Graphics image
-!:mime image/svg
+!:mime image/svg+xml

 # Sitemap file
 0 string/t \<?xml\ version=
Tagsmagic

Activities

izhidkov

2019-09-26 14:05

reporter  

example.svg (2,727 bytes)   
example.svg (2,727 bytes)   
svg_magic.patch (288 bytes)   
--- a/file/magic/Magdir/sgml
+++ b/file/magic/Magdir/sgml
@@ -10,7 +10,7 @@
 >>19	search/4096	\<gnc-v2		GnuCash file
 !:mime	application/x-gnucash
 0	string		\<svg			SVG Scalable Vector Graphics image
-!:mime	image/svg
+!:mime	image/svg+xml

 # Sitemap file
 0	string/t		\<?xml\ version=
svg_magic.patch (288 bytes)   

christos

2019-09-30 15:45

manager   ~0003309

Fixed, thanks!

Issue History

Date Modified Username Field Change
2019-09-26 14:05 izhidkov New Issue
2019-09-26 14:05 izhidkov File Added: example.svg
2019-09-26 14:05 izhidkov File Added: svg_magic.patch
2019-09-26 14:05 izhidkov Tag Attached: magic
2019-09-30 15:44 christos Assigned To => christos
2019-09-30 15:44 christos Status new => assigned
2019-09-30 15:45 christos Status assigned => resolved
2019-09-30 15:45 christos Resolution open => fixed
2019-09-30 15:45 christos Fixed in Version => 5.38
2019-09-30 15:45 christos Note Added: 0003309