summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2019-09-16 20:28:03 +0200
committerBastien Nocera <hadess@hadess.net>2019-09-16 20:28:03 +0200
commitfe8b8a9d97ee2218aa80dfc8000a961b82871299 (patch)
tree9cb84d2749d04eda17821fc292e0445059a01cc6
parent243a4560624a0da0b1452331777c43b122c76b24 (diff)
downloadshared-mime-info-fe8b8a9d97ee2218aa80dfc8000a961b82871299.tar.gz
Make files that start with "<svg" unequivocal SVG files
-rw-r--r--freedesktop.org.xml.in7
-rw-r--r--tests/list2
-rw-r--r--tests/terminal-app.svg53
3 files changed, 60 insertions, 2 deletions
diff --git a/freedesktop.org.xml.in b/freedesktop.org.xml.in
index 9c51ac65..bee7122d 100644
--- a/freedesktop.org.xml.in
+++ b/freedesktop.org.xml.in
@@ -4918,9 +4918,12 @@ command to generate the output files.
<magic priority="80">
<match type="string" value="&lt;!DOCTYPE svg" offset="0:256"/>
</magic>
- <magic priority="45">
- <match type="string" value="&lt;svg" offset="0:256"/>
+ <magic priority="80">
<match type="string" value="&lt;!-- Created with Inkscape" offset="0"/>
+ <match type="string" value="&lt;svg" offset="0"/>
+ </magic>
+ <magic priority="45">
+ <match type="string" value="&lt;svg" offset="1:256"/>
</magic>
<glob pattern="*.svg"/>
<root-XML namespaceURI="http://www.w3.org/2000/svg" localName="svg"/>
diff --git a/tests/list b/tests/list
index 3022f4a5..1cc8929c 100644
--- a/tests/list
+++ b/tests/list
@@ -108,6 +108,8 @@ rgb-reference.ktx image/ktx
dnd-counter.svg image/svg+xml
# Copied from https://github.com/linuxmint/mint-x-icons/tree/master/usr/share/icons/Mint-X-Aqua/places/128
folder.svg image/svg+xml
+# Copied from https://gitlab.freedesktop.org/xdg/shared-mime-info/issues/116#note_225851
+terminal-app.svg image/svg+xml
# Documents
ooo-6.0.doc application/msword
diff --git a/tests/terminal-app.svg b/tests/terminal-app.svg
new file mode 100644
index 00000000..beb62247
--- /dev/null
+++ b/tests/terminal-app.svg
@@ -0,0 +1,53 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="enable-background:new" width="256" height="256" version="1.0" viewBox="0 0 256 256">
+ <title id="title4162">
+ Adwaita Icon Template
+ </title>
+ <defs>
+ <linearGradient id="linearGradient965" x1="48" x2="464" y1="44" y2="44" gradientUnits="userSpaceOnUse">
+ <stop id="stop989" offset="0" style="stop-color:#77767b"/>
+ <stop id="stop991" offset=".05" style="stop-color:#c0bfbc"/>
+ <stop id="stop993" offset=".1" style="stop-color:#9a9996"/>
+ <stop id="stop995" offset=".9" style="stop-color:#9a9996"/>
+ <stop id="stop997" offset=".95" style="stop-color:#c0bfbc"/>
+ <stop id="stop999" offset="1" style="stop-color:#77767b"/>
+ </linearGradient>
+ <radialGradient id="radialGradient1030" cx="64" cy="194.19" r="44" gradientTransform="matrix(-4.7273,7.9359e-7,-3.0301e-7,-1.6364,238.55,49.766)" gradientUnits="userSpaceOnUse">
+ <stop id="stop1016" offset="0" style="stop-color:#fff"/>
+ <stop id="stop1018" offset="1" style="stop-color:#fff;stop-opacity:.094118"/>
+ </radialGradient>
+ <linearGradient id="linearGradient1950" x1="70.347" x2="70.347" y1="245.4" y2="269.14" gradientUnits="userSpaceOnUse">
+ <stop id="stop1944" offset="0" style="stop-color:#2d2839"/>
+ <stop id="stop1946" offset="1" style="stop-color:#282433"/>
+ </linearGradient>
+ <linearGradient id="linearGradient918" x1="252.122" x2="21.425" y1="210.694" y2="210.694" gradientUnits="userSpaceOnUse" xlink:href="#linearGradient916"/>
+ <linearGradient id="linearGradient916">
+ <stop style="stop-color:#000000" id="stop912" offset="0"/>
+ <stop style="stop-color:#000000;stop-opacity:0" id="stop914" offset="1"/>
+ </linearGradient>
+ <filter style="color-interpolation-filters:sRGB" id="filter920" width="1.103" height="1.143" x="-.05" y="-.07">
+ <feGaussianBlur id="feGaussianBlur922" stdDeviation="3.138"/>
+ </filter>
+ <linearGradient id="linearGradient4358" x1="88" x2="488" y1="88" y2="488" gradientTransform="rotate(-90,287.9946,298)" gradientUnits="userSpaceOnUse" xlink:href="#linearGradient4360"/>
+ <linearGradient id="linearGradient4360">
+ <stop id="stop4362" offset="0" style="stop-color:#000000;stop-opacity:0.58823532"/>
+ <stop style="stop-color:#000000;stop-opacity:0" id="stop4364" offset=".88"/>
+ <stop id="stop4366" offset="1" style="stop-color:#000000"/>
+ </linearGradient>
+ <filter style="color-interpolation-filters:sRGB" id="filter4380" width="1.106" height="1.088" x="-.05" y="-.04">
+ <feGaussianBlur id="feGaussianBlur4382" stdDeviation="8.48"/>
+ </filter>
+ <filter style="color-interpolation-filters:sRGB" id="filter4346" width="1.026" height="1.022" x="-.01" y="-.01">
+ <feGaussianBlur id="feGaussianBlur4348" stdDeviation="2.12"/>
+ </filter>
+ </defs>
+ <path style="opacity:0.1;filter:url(#filter4346)" d="M 189.84323,74 C 119.24979,74 111.65402,81.250835 112,151.98706 V 298 444.01294 C 111.65402,514.74917 119.24979,522 189.84323,522 H 386.15677 C 456.75021,522 462.16345,514.72616 464,444.01294 V 298 151.98706 C 464,81.249993 456.75021,74 386.15677,74 Z" transform="matrix(0,0.5,-0.5,0,276.82523,-15.328148)"/>
+ <path d="M 189.84323,74 C 119.24979,74 111.65402,81.250835 112,151.98706 V 298 444.01294 C 111.65402,514.74917 119.24979,522 189.84323,522 H 386.15677 C 456.75021,522 464,514.75001 464,444.01294 V 298 151.98706 C 464,81.249993 456.75021,74 386.15677,74 Z" transform="matrix(0,0.5,-0.5,0,276.82523,-15.328148)" style="opacity:0.3;fill:url(#linearGradient4358);filter:url(#filter4380)"/>
+ <path style="opacity:0.1" d="m 241.83043,77.478254 c 0,-36.098811 -3.69016,-39.983003 -39.68984,-39.806081 H 127.83043 53.520276 c -35.99969,-0.176922 -39.68984,3.70727 -39.68984,39.806081 V 177.86558 c 0,36.09881 3.68973,39.80608 39.68984,39.80608 h 74.310154 74.31016 c 36.00011,0 39.68984,-3.70727 39.68984,-39.80608 z"/>
+ <path style="fill:#4d4d4d" d="m 239.82523,176.74484 c 0,35.29673 -3.62542,39.09461 -38.99353,38.92162 H 127.82523 54.818766 c -35.36812,0.17299 -38.99353,-3.62489 -38.99353,-38.92162 V 78.588074 c 0,-35.296716 3.625,-38.921616 38.99353,-38.921616 h 73.006464 73.00647 c 35.36853,0 38.99353,3.6249 38.99353,38.921616 z"/>
+ <path style="opacity:0.3;fill:#ffffff" d="m 54.81817,39.667201 c -35.36853,0 -38.992187,3.623202 -38.992187,38.919923 v 98.158206 c 0,0.0882 0.0019,0.16224 0.002,0.25 V 80.585174 c -4.7e-5,-35.29672 3.625564,-38.921879 38.994094,-38.921879 h 73.005853 73.00586 c 35.28016,0 38.97394,3.621035 38.99219,38.671879 v -1.74805 c 0,-35.296721 -3.62561,-38.919923 -38.99414,-38.919923 h -73.00586 z"/>
+ <path style="opacity:0.2" d="m 15.825983,174.74533 v 2 c 0,35.29673 3.624067,39.09487 38.992187,38.92188 h 73.00781 73.00586 c 35.36811,0.17299 38.99414,-3.62515 38.99414,-38.92188 v -2 c 0,35.29673 -3.62603,39.09487 -38.99414,38.92188 H 127.82598 54.81817 C 19.45005,213.8402 15.825983,210.04206 15.825983,174.74533 Z"/>
+ <path style="opacity:0.05;fill:#ffffff" d="m 15.825983,119.66916 v 57.07617 c 0,35.29673 3.624067,39.09487 38.992187,38.92188 h 73.00781 73.00586 c 35.36811,0.17299 38.99414,-3.62515 38.99414,-38.92188 v -57.07617 z"/>
+ <path style="opacity:0.5;fill:url(#linearGradient918);filter:url(#filter920)" d="m 110.85775,138 -4.93526,14.80579 50.10039,20.04015 -50.10039,20.04016 4.93526,14.80578 64.45752,-27.21872 v -15.25444 z m 64.36555,90.03114 v 15.10489 h 76.69918 v -15.10489 z" transform="matrix(0.52016215,0,0,0.52160725,-3.3168708,-6.2307045)"/>
+ <path style="fill:#f2f2f2" d="m 54.347139,64.707879 -2.56714,7.722805 26.060317,10.45309 -26.060317,10.45309 2.56714,7.722806 33.528357,-14.197476 v -7.95683 z m 33.480517,46.960901 v 8 h 39.999994 v -8 z"/>
+ <path style="fill:#ffffff" d="m 54.347279,64.707879 -2.56728,7.723255 0.3058,0.12225 2.26148,-6.80229 33.528107,14.1975 v -1.04322 z m 22.192227,18.697375 -24.759507,9.93194 0.3058,0.92096 25.754117,-10.33129 z m 11.28782,28.263586 v 1.04321 h 40.000324 v -1.04321 z"/>
+</svg>