Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shared-mime-types as upstream source #312

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rimmington
Copy link

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 of x- types I think it's sensible to include them all.

Comment on lines 438 to 441
"application/dicom": {
"source": "iana"
"source": "iana",
"extensions": ["dcm"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 623 to 626
"application/fits": {
"source": "iana"
"source": "iana",
"extensions": ["fits","fit","fts"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 805 to 809
"application/jrd+json": {
"source": "iana",
"compressible": true
"compressible": true,
"extensions": ["jrd"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 933 to 937
"application/mathml+xml": {
"source": "iana",
"compressible": true,
"extensions": ["mathml"]
"extensions": ["mathml","mml"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 1425 to 1429
"application/rdf+xml": {
"source": "iana",
"compressible": true,
"extensions": ["rdf","owl"]
"extensions": ["rdf","rdfs","owl"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 1684 to 1688
"application/smil+xml": {
"source": "iana",
"compressible": true,
"extensions": ["smi","smil"]
"extensions": ["smi","smil","sml","kino"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.sml correct per https://www.iana.org/assignments/media-types/application/smil , but .kino is not mentioned there

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 1699 to 1702
"application/sparql-query": {
"source": "iana",
"extensions": ["rq"]
"extensions": ["rq","qs"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 2165 to 2168
"application/vnd.adobe.flash.movie": {
"source": "iana"
"source": "iana",
"extensions": ["swf","spl"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 2258 to 2261
"application/vnd.amazon.mobi8-ebook": {
"source": "iana"
"source": "iana",
"extensions": ["azw3","kfx"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

@jayvdb jayvdb Nov 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in https://gitlab.freedesktop.org/xdg/shared-mime-info/-/commit/4bae2a489c52f8314a21a949223e846151bcccb9

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

Comment on lines 2340 to 2343
"application/vnd.apple.mpegurl": {
"source": "iana",
"extensions": ["m3u8"]
"extensions": ["m3u8","m3u"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 2485 to 2488
"application/vnd.chess-pgn": {
"source": "iana"
"source": "iana",
"extensions": ["pgn"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 2534 to 2537
"application/vnd.coffeescript": {
"source": "iana"
"source": "iana",
"extensions": ["coffee"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 2573 to 2576
"application/vnd.comicbook-rar": {
"source": "iana"
"source": "iana",
"extensions": ["cbr"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 2919 to 2922
"application/vnd.efi.iso": {
"source": "iana"
"source": "iana",
"extensions": ["iso","iso9660"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -3727,7 +3814,7 @@
},
"application/vnd.lotus-1-2-3": {
"source": "iana",
"extensions": ["123"]
"extensions": ["123","wk1","wk3","wk4","wks"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.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"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines 4023 to 4027
"application/vnd.ms-excel": {
"source": "iana",
"compressible": false,
"extensions": ["xls","xlm","xla","xlc","xlt","xlw"]
"extensions": ["xls","xlm","xla","xlc","xlt","xlw","xll","xld"]
},
Copy link

@jayvdb jayvdb Nov 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 4405 to 4408
"application/vnd.oasis.opendocument.formula-template": {
"source": "iana",
"extensions": ["odft"]
"extensions": ["odft","otf"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -5274,7 +5419,7 @@
},
"application/vnd.smaf": {
"source": "iana",
"extensions": ["mmf"]
"extensions": ["mmf","smaf"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 5462 to +5465
"application/vnd.sqlite3": {
"source": "iana"
"source": "iana",
"extensions": ["sqlite3"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 5849 to 5852
"application/vnd.wordperfect": {
"source": "iana",
"extensions": ["wpd"]
"extensions": ["wpd","wp","wp4","wp5","wp6","wpp"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 7499 to 7502
"application/x-x509-ca-cert": {
"source": "iana",
"extensions": ["der","crt","pem"]
"extensions": ["der","crt","pem","cert"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 7622 to 7626
"application/xhtml+xml": {
"source": "iana",
"compressible": true,
"extensions": ["xhtml","xht"]
"extensions": ["xhtml","xht","html","htm"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 7636 to 7640
"application/xml": {
"source": "iana",
"compressible": true,
"extensions": ["xml","xsl","xsd","rng"]
"extensions": ["xml","xsl","xbl","xsd","rng"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment on lines 7646 to 7649
"application/xml-external-parsed-entity": {
"source": "iana"
"source": "iana",
"extensions": ["ent"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 7715 to 7719
"application/zip": {
"source": "iana",
"compressible": false,
"extensions": ["zip"]
"extensions": ["zip","zipx"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 7720 to 7723
"application/zlib": {
"source": "iana"
"source": "iana",
"extensions": ["zz"]
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jayvdb
Copy link

jayvdb commented Nov 23, 2024

A bit of a marathon - I've reviewed all the application/ which currently have a source of "iana". Initially I commented on a few to indicate they matched IANA records, but that was too many so I switched to only commenting when there was a discrepancy. I have analysed most of the discrepancies - while a few I feel are adding too many extensions, in most cases these are harmless, as there are no other media/mime types using that extension.

.qs and .lib and .htm and .html seem like the most problematic. Overall I would suggest this PR is a good approach, and any problems can be solved by people working with the upstream project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants