Add shared-mime-types as upstream source#312
Conversation
| "application/dicom": { | ||
| "source": "iana" | ||
| "source": "iana", | ||
| "extensions": ["dcm"] | ||
| }, |
There was a problem hiding this comment.
This is correct - I think the quotes in https://www.iana.org/assignments/media-types/application/dicom are causing this extension to be omitted from mime-db at the moment.
| "application/fits": { | ||
| "source": "iana" | ||
| "source": "iana", | ||
| "extensions": ["fits","fit","fts"] | ||
| }, |
There was a problem hiding this comment.
| "application/jrd+json": { | ||
| "source": "iana", | ||
| "compressible": true | ||
| "compressible": true, | ||
| "extensions": ["jrd"] | ||
| }, |
There was a problem hiding this comment.
| "application/mathml+xml": { | ||
| "source": "iana", | ||
| "compressible": true, | ||
| "extensions": ["mathml"] | ||
| "extensions": ["mathml","mml"] | ||
| }, |
There was a problem hiding this comment.
| "application/rdf+xml": { | ||
| "source": "iana", | ||
| "compressible": true, | ||
| "extensions": ["rdf","owl"] | ||
| "extensions": ["rdf","rdfs","owl"] | ||
| }, |
There was a problem hiding this comment.
.rdfs is not mentioned at https://www.iana.org/assignments/media-types/application/rdf+xml
There was a problem hiding this comment.
It was added at https://gitlab.freedesktop.org/xdg/shared-mime-info/-/commit/150637a3c0ec0b4f321bd49dc41650b8e71c559f - Closes: #8389 refers to https://bugs.freedesktop.org/show_bug.cgi?id=8389 , which is thankfully still operational. So in addition to commit messages, the background which led to each commit is likely also available.
fwiw, .rdfs is RDF Schema , and it is expressed as a RDF, and can be serialised as XML, so this addition is fine.
| "application/smil+xml": { | ||
| "source": "iana", | ||
| "compressible": true, | ||
| "extensions": ["smi","smil"] | ||
| "extensions": ["smi","smil","sml","kino"] | ||
| }, |
There was a problem hiding this comment.
.sml correct per https://www.iana.org/assignments/media-types/application/smil , but .kino is not mentioned there
There was a problem hiding this comment.
https://gitlab.freedesktop.org/xdg/shared-mime-info/-/commit/aeec6ec3c98441db041e81274478c41dd9a38483 & https://bugs.freedesktop.org/show_bug.cgi?id=3141
This is about Linux only software discontinued in 2009 https://en.wikipedia.org/wiki/Kino_(software)
https://sourceforge.net/p/kino/code/HEAD/tree/trunk/smilutils/ and the manpage under that dont give any indication that .dino was a recommended extension.
However there are some hits on github for .kino being used for smil files https://github.com/search?q=path%3A*.kino&type=code
So this looks like a low value extension, but still valid.
| "application/sparql-query": { | ||
| "source": "iana", | ||
| "extensions": ["rq"] | ||
| "extensions": ["rq","qs"] | ||
| }, |
There was a problem hiding this comment.
.qs not mentioned on https://www.iana.org/assignments/media-types/application/sparql-query
There was a problem hiding this comment.
Added in https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/176 ; I cant see any evidence for .qs being used for this, and github results are drowned out with it being used for https://doc.qt.io/qt-5/qtscript-index.html and other scripting languages.
| "application/vnd.adobe.flash.movie": { | ||
| "source": "iana" | ||
| "source": "iana", | ||
| "extensions": ["swf","spl"] | ||
| }, |
There was a problem hiding this comment.
https://www.iana.org/assignments/media-types/application/vnd.adobe.flash.movie mentions the commonly used .swf , but not .spl
There was a problem hiding this comment.
Added in https://gitlab.freedesktop.org/xdg/shared-mime-info/-/commit/298543c7e449165b46a85d71209faf42de508217 - .sql is added with the media type of Futuresplash
https://www.webdesignmuseum.org/software/futuresplash-animator-in-1996 lists "FutureSplash Player SPL (Export)" under image formats, not animation formats, so I suspect that they are two different formats.
https://en.wikipedia.org/wiki/SWF lists .spl as a "Related file formats and extension"
ruffle-rs/ruffle#18260 and https://github.com/ruffle-rs/ruffle/blob/295bd1062cfa281beeb4371f44b3cfb53c12171b/web/packages/core/src/swf-utils.ts#L24 says .spl is the same as .swf
First few pages of https://github.com/search?q=path%3A*.spl&type=code are not flash.
I am not 100% sure, but this seems to be ok.
| "application/vnd.amazon.mobi8-ebook": { | ||
| "source": "iana" | ||
| "source": "iana", | ||
| "extensions": ["azw3","kfx"] | ||
| }, |
There was a problem hiding this comment.
.azw3 mentioned on https://www.iana.org/assignments/media-types/application/vnd.amazon.mobi8-ebook , but not .kfx
There was a problem hiding this comment.
which says
Alias from:
kovidgoyal/calibre@ddca079#diff-64773d34b80f6772011eb6c82d9fa5ddR37
That commit does include the media type alias, but does not contain .kfx
It seems .kfx is a very different format from the previous versions of Kindle files https://www.quora.com/What-is-Kindle-KFX
Only one github example https://github.com/midrare/krdsrw/blob/55f7eef3d23003f79dd55b17d3e78b6a663789bb/tests/the-tempest.kfx
A bit of background at https://en.wikipedia.org/wiki/Kindle_File_Format
| "application/vnd.apple.mpegurl": { | ||
| "source": "iana", | ||
| "extensions": ["m3u8"] | ||
| "extensions": ["m3u8","m3u"] | ||
| }, |
There was a problem hiding this comment.
| "application/vnd.chess-pgn": { | ||
| "source": "iana" | ||
| "source": "iana", | ||
| "extensions": ["pgn"] | ||
| }, |
There was a problem hiding this comment.
| "application/vnd.coffeescript": { | ||
| "source": "iana" | ||
| "source": "iana", | ||
| "extensions": ["coffee"] | ||
| }, |
There was a problem hiding this comment.
| "application/vnd.comicbook-rar": { | ||
| "source": "iana" | ||
| "source": "iana", | ||
| "extensions": ["cbr"] | ||
| }, |
There was a problem hiding this comment.
| "application/vnd.efi.iso": { | ||
| "source": "iana" | ||
| "source": "iana", | ||
| "extensions": ["iso","iso9660"] | ||
| }, |
There was a problem hiding this comment.
Only .iso mentioned on https://www.iana.org/assignments/media-types/application/vnd.efi.iso
One hit for .iso9660 at https://github.com/search?q=path%3A*.iso9660&type=code
| @@ -3727,7 +3814,7 @@ | |||
| }, | |||
| "application/vnd.lotus-1-2-3": { | |||
| "source": "iana", | |||
| "extensions": ["123"] | |||
| "extensions": ["123","wk1","wk3","wk4","wks"] | |||
There was a problem hiding this comment.
.wks not mentioned on https://www.iana.org/assignments/media-types/application/vnd.lotus-1-2-3 , but it is an early version of the file format.
| @@ -3826,7 +3913,8 @@ | |||
| "extensions": ["igx"] | |||
| }, | |||
| "application/vnd.microsoft.portable-executable": { | |||
| "source": "iana" | |||
| "source": "iana", | |||
| "extensions": ["exe","dll","cpl","drv","scr","efi","ocx","sys","lib"] | |||
There was a problem hiding this comment.
https://www.iana.org/assignments/media-types/application/vnd.microsoft.portable-executable only lists .exe and .dll
Long commit message at https://gitlab.freedesktop.org/xdg/shared-mime-info/-/commit/d4c2ed1b62b51fed1f9fa003de6cfdc6a82df729
I think .lib may be misguided - they are COFF files on Windows.
It looks like they are getting that long list of file extensions from the infobox on http://fileformats.archiveteam.org/wiki/Portable_Executable
| "application/vnd.ms-excel": { | ||
| "source": "iana", | ||
| "compressible": false, | ||
| "extensions": ["xls","xlm","xla","xlc","xlt","xlw"] | ||
| "extensions": ["xls","xlm","xla","xlc","xlt","xlw","xll","xld"] | ||
| }, |
There was a problem hiding this comment.
The Microsoft ones like https://www.iana.org/assignments/media-types/application/vnd.ms-excel is very strange
| "application/vnd.oasis.opendocument.formula-template": { | ||
| "source": "iana", | ||
| "extensions": ["odft"] | ||
| "extensions": ["odft","otf"] | ||
| }, |
There was a problem hiding this comment.
https://www.iana.org/assignments/media-types/application/vnd.oasis.opendocument.formula-template only lists .otf, not the pre-existing .otft
| @@ -5274,7 +5419,7 @@ | |||
| }, | |||
| "application/vnd.smaf": { | |||
| "source": "iana", | |||
| "extensions": ["mmf"] | |||
| "extensions": ["mmf","smaf"] | |||
There was a problem hiding this comment.
.smaf not on https://www.iana.org/assignments/media-types/application/vnd.smaf
None at https://github.com/search?q=path%3A*.smaf&type=code
I dont see a lot of evidence of .smaf being used
| "application/vnd.sqlite3": { | ||
| "source": "iana" | ||
| "source": "iana", | ||
| "extensions": ["sqlite3"] | ||
| }, |
There was a problem hiding this comment.
https://www.iana.org/assignments/media-types/application/vnd.sqlite3 suggests others also: .sqlite & .db
| "application/vnd.wordperfect": { | ||
| "source": "iana", | ||
| "extensions": ["wpd"] | ||
| "extensions": ["wpd","wp","wp4","wp5","wp6","wpp"] | ||
| }, |
There was a problem hiding this comment.
| "application/x-x509-ca-cert": { | ||
| "source": "iana", | ||
| "extensions": ["der","crt","pem"] | ||
| "extensions": ["der","crt","pem","cert"] | ||
| }, |
There was a problem hiding this comment.
https://www.iana.org/assignments/media-types/application/x-x509-ca-cert lists 0 extensions
| "application/xhtml+xml": { | ||
| "source": "iana", | ||
| "compressible": true, | ||
| "extensions": ["xhtml","xht"] | ||
| "extensions": ["xhtml","xht","html","htm"] | ||
| }, |
There was a problem hiding this comment.
https://www.iana.org/assignments/media-types/application/xhtml+xml lists only "xhtml","xht"
This is one where I feel that adding "html","htm" probably makes this mime-db less useful, as those file extensions are very commonly used, and very unlikely to be XML most of the time.
| @@ -6495,20 +7631,21 @@ | |||
| "application/xliff+xml": { | |||
| "source": "iana", | |||
| "compressible": true, | |||
| "extensions": ["xlf"] | |||
| "extensions": ["xlf","xliff"] | |||
There was a problem hiding this comment.
https://www.iana.org/assignments/media-types/application/xliff+xml only lists xlf
But https://github.com/search?q=path%3A*.xliff&type=code shows a lot of positive hits
| "application/xml": { | ||
| "source": "iana", | ||
| "compressible": true, | ||
| "extensions": ["xml","xsl","xsd","rng"] | ||
| "extensions": ["xml","xsl","xbl","xsd","rng"] | ||
| }, |
There was a problem hiding this comment.
https://www.iana.org/assignments/media-types/application/xml only lists .xml
.xbl is part of XUL , a UI language which failed standardisation, and doesnt have a lot of usage these days (sob).
| "application/xml-external-parsed-entity": { | ||
| "source": "iana" | ||
| "source": "iana", | ||
| "extensions": ["ent"] | ||
| }, |
There was a problem hiding this comment.
https://www.iana.org/assignments/media-types/application/xml-external-parsed-entity says ".xml" or ".ent" 👍
| "application/zip": { | ||
| "source": "iana", | ||
| "compressible": false, | ||
| "extensions": ["zip"] | ||
| "extensions": ["zip","zipx"] | ||
| }, |
There was a problem hiding this comment.
https://www.iana.org/assignments/media-types/application/zip doesnt mention zipx
| "application/zlib": { | ||
| "source": "iana" | ||
| "source": "iana", | ||
| "extensions": ["zz"] | ||
| }, |
There was a problem hiding this comment.
https://www.iana.org/assignments/media-types/application/zlib doesnt provide any file extensions
|
A bit of a marathon - I've reviewed all the
|
|
Wow thanks @jayvdb for the review and @rimmington for the PR. I think we need to consider how we want to approach a new source in terms of semver-ness here. AFAIK this would be the first such additional source and therefore likely needs a bit more consideration than just the data changes (not to say those are not also critical, and thanks again for reviewing those @jayvdb). I am not sure I have a really strong opinion, but to be sure we get a few more eyes on this I will also ping in out @jshttp/express-tc. |
|
I see this PR for a future version 2 of mime-db, which I would think would be ideal, before adding it to version 1. |
Adds Freedesktop.org's shared-mime-info repository as an upstream. shared-mime-info is used by common Linux desktop environments for MIME information, typically to identify which application to use to open a file. I've generally found sensible rationales for inclusion and changes in the commit messages of the repository.
There are quite a lot of
x-types in this source, which reflects the upstream need for a file type for each format even if there is no IANA official or consensus type. Given that both Apache and Nginx also have a lot ofx-types I think it's sensible to include them all.