summaryrefslogtreecommitdiff
path: root/tests/mime-detection
Commit message (Collapse)AuthorAgeFilesLines
* Add Electron Archive Format type application/x-asarKai Uwe Broulik2022-03-132-0/+2
| | | | | | | | | Formerly known as "Atom Shell Archive Format" [1]. Unofficial MIME type also used by NPM "file-type" library [2]. [1] https://github.com/electron/asar [2] https://github.com/sindresorhus/file-type/blob/main/core.d.ts#L274
* text/x-qml: Lower match priority to avoid conflicts with PythonPhilip Withnall2022-03-132-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | GLib takes priorities >= 80 to mean a short-circuit to a magic match, overriding any conflicting matching globs. More generally, high priority magic should only be used if it’s really unlikely that the magic will match anything except the given MIME type. That’s evidently not true here. Some Python files which import Qt modules can look like valid QML files, matching the magic but not the glob. Lower the priority of the magic so that it doesn’t trigger the short-circuit code in GLib. This means the name match is guessed as the right one instead of the magic match. See https://gitlab.gnome.org/GNOME/glib/-/blob/6ee71750a532d8de5eaed5cf12e8718738ddd5c6/gio/gcontenttype.c#L840 and https://gitlab.gnome.org/GNOME/glib/-/issues/2599. Tested with `XDG_DATA_DIRS=$buildroot/share gio info ./not-qml.py`. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #84
* Adding SPARQL media typesGiovanni Alfredo Garciliano Díaz2022-02-163-0/+43
|
* application/zip: Add `*.zipx` glob and test fixtureMark Ultra2022-02-142-0/+2
|
* Added DSD mime typeFelix Plamper2022-02-083-0/+4
|
* FITS: Add missing `application/fits` and legacy globsAllison Reid2022-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make `image/fits` an alias, matching its designation of a subset of the FITS standard, as per https://datatracker.ietf.org/doc/html/rfc4047#section-5 - "The general nature of the full FITS standard requires the use of the media type "application/fits". Nevertheless, the principal intent for a great many FITS files is to convey a single data array in the PHDU, and such arrays are very often 2-dimensional images. Several common image viewing applications already display single-HDU FITS files, and the prototypes for virtual observatory projects specify that data provided by web services be conveyed by the data array in the PHDU. These uses justify the registration of a second media type, namely "image/fits", for files which use the subset of the standard described by the original FITS standard paper." The existing alias `image/x-fits` was common before the standardization of `application/fits` and `image/fits`, so it should stay. Current standards and historical contexts can be found here: - https://fits.gsfc.nasa.gov/fits_standard.html - https://listmgr.nrao.edu/pipermail/fitsmime/2002-December/thread.html - https://www.ucolick.org/~sla/fits/mime/comments.html Add missing eight-dot-three-style `*.fit` and `*.fts` globs for legacy files, matching the list supported by `libvips`, i.e., https://github.com/libvips/libvips/blob/757d03100566368e5d06c7355e73c1215dd34968/libvips/foreign/fits.c#L132 And as discussed in the FITS standard definition (`fits_standard40aa-le.pdf`) - "In the absence of other information it is reasonably safe to presume that a file name ending in ‘.fits’ is intended to be a FITS file. Nevertheless, there are other commonly used ex- tensions; e.g., ‘.fit’, ‘.fts’, and many others not suitable for listing in a media type registration."
* Add Godot engine filesMichael Alexsander2021-12-139-1/+248
|
* Add FlashForge "xgcode" mime-typeBastien Nocera2021-12-122-0/+1
| | | | | | | FlashForge's FlashPrint software uses gcode with a binary header containing extra data to save sliced models. Seeing as they have a known magic and that we might want to use them outside of FlashPrint itself, add a mime-type.
* text/x-objc++src: new typeIgor Kushnir2021-12-128-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | This MIME type name is used in Qt Creator [1] and KDevelop [2]. A different name - text/x-objcpp-src - is used in KSyntaxHighlighting [3]. The name text/x-objc++src is consistent with the existing MIME type names text/x-c++src and text/x-objcsrc. So KSyntaxHighlighting's name will have to be replaced later. The Objective-C Wikipedia article and the KSyntaxHighlighting's data file [3] claim that *.M is one of the file extensions of Objective-C++ source files. But since macOS's file system is case-insensitive by default, *.mm is used almost universally. Thus there is no need to complicate the MIME type database with case-sensitive attributes. Make text/x-troff-mm a subclass of text/troff to reuse its magic element. As far as I can tell, these two file formats share the same comment syntax, which is encoded in text/troff's magic. Add Objective-C, Objective-C++, Troff, Troff MM and C tests to verify correct detection of the new MIME type and the absence of regressions. [1] https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/plugins/cppeditor/CppEditor.json.in?id=2cc28dea65846153d16c213283ffac7af530590d#n100 [2] https://invent.kde.org/kdevelop/kdevelop/-/blob/ebd207cca2387b5734a591803381880505e39a30/plugins/astyle/astyle_plugin.cpp#L284 [3] https://invent.kde.org/frameworks/syntax-highlighting/-/blob/0b2c0dc5368de519c4e9517a4dec69017df4cd6c/data/syntax/objectivecpp.xml#L3
* image/heif: test .hif extension tooVille Skyttä2021-12-122-1/+1
| | | | https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/151#note_1098689
* image/heif: add another test caseVille Skyttä2021-12-122-0/+2
|
* image/heif: add magicsVille Skyttä2021-12-121-2/+2
| | | | https://nokiatech.github.io/heif/technical.html
* Add Apple Wallet pass type application/vnd.apple.pkpassKai Uwe Broulik2021-12-022-0/+1
| | | | | | | De-facto standard mentioned by Apple in [1] and [2]. [1] https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/PassKit_PG/DistributingPasses.html [2] https://developer.apple.com/documentation/walletpasses/send_an_updated_pass
* Generate and commit a missing test fileIgor Kushnir2021-10-101-0/+1
| | | | | | | | | | | | | b969e1c74e7c905a96c1590f5350a264dbaa83ae added a reference to this file and a command to generate it into tests/mime-detection/list, but didn't commit the generated file itself. Now when test-mime fails for some other reason (e.g. after adding a failing test case), the following error message is printed: Could not open /path/to/shared-mime-info/tests/mime-detection/test-not-dtshd.txt Presumably when the test file does not exist, the intended 'data' test does not run. The testing system should be improved to report such nonexistent file issues as test failures.
* Adding ZIM fileGiovanni Alfredo Garciliano Díaz2021-10-102-0/+2
|
* Add text/x-mpl2Ignacy Kuchciński2021-09-302-0/+908
|
* application/x-apple-systemprofiler+xml: require _SPCommandLineArguments in plistwork/scop/jpeg-vs-systemprofilerVille Skyttä2021-09-081-0/+3
| | | | | | | | | | | | | | Look for `<key>_SPCommandLineArguments</key>` in addition to plist root element to distinguish from other property list XML files. Our offset specifiers aren't that fancy, so this can trigger on files that have the above string ´_before_ `<plist version="1.0"`, but those should be quite pathological cases. Start offset 34 is length of `<plist version="1.0"><array><dict>`, 384 is arbitrary guesswork. Closes https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/169
* image/jpeg: add test case with embedded property list XMLVille Skyttä2021-09-082-0/+4
| | | | https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/169
* audio/vnd.dts.hd: include parent type magic in magic matchVille Skyttä2021-08-111-0/+2
| | | | | | | | | | | | | | | | | | | Matching just 0x64582025 within the first 18725 bytes of any file is prone to false positives. The priority of the magic match here being bumped to 60 seems to indicate intent to make it take precedence over the parent `audio/vnd.dts`. But we should take the parent magic into account here as it does not "inherit" with `sub-class-of`. As the comment for this match says "16bits HD be", accept only "16bits core be" as the parent at least for now, not all possible parent magics -- it would not seem consistent to have it in "14bits" variants, or the "16bits core le" one. The test case we have for this is one matching "16bits core be". Refs https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/166 Refs https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/167
* model/gltf+json: new typeVille Skyttä2021-07-292-0/+57
| | | | https://www.iana.org/assignments/media-types/model/gltf+json
* model/gltf-binary: new typeVille Skyttä2021-07-292-0/+2
| | | | https://www.iana.org/assignments/media-types/model/gltf-binary
* application/x-object: add *.mod and a test caseVille Skyttä2021-07-302-1/+2
| | | | | | For GRUB modules. Closes https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/165
* application/x-mod: add some ProTracker magics and a test caseVille Skyttä2021-07-302-0/+2
| | | | https://wiki.multimedia.cx/index.php/Protracker_Module#File_Format
* *: delete trailing whitespaceVille Skyttä2021-07-301-3/+3
|
* image/jxl: include test files in test listVille Skyttä2021-06-301-0/+2
| | | | | | | | I failed to include the test files in the list in 238f20f82d485dafa16904c5bd1b07c8034ddacd, and unfortunately can no longer remember their origin. I likely took an existing one from the test suite and converted from it, but the details and tools used escape me.
* tests: add trailing linefeed to mime-detection listVille Skyttä2021-06-281-1/+1
| | | | | | My editor keeps adding it (which is nice), but I need to remove it manually all the time not to include it as unrelated whitespace in other commits (which is not). Just add it.
* application/x-x509-ca-cert: add magics and test casesVille Skyttä2021-06-243-0/+64
| | | | | | "BEGIN/END CA CERTIFICATE" seems to be a thing, although not that common. "BEGIN/END TRUSTED CERTIFICATE" is an OpenSSL marker for trusted certificates, see x509(1).
* application/pkix-cert: add BEGIN/END X509 CERTIFICATE magicVille Skyttä2021-06-242-0/+32
|
* application/pkix-crl: add magic and test caseVille Skyttä2021-06-242-0/+19
|
* application/pkix-cert: add magic and test caseVille Skyttä2021-06-242-0/+32
|
* image/jxl: new typeVille Skyttä2021-06-062-0/+0
| | | | Closes https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/159
* application/schema+json: new typeAlex Henrie2021-05-282-0/+7
| | | | | | | JSON Schema files are distinguished from other JSON files by a "$schema" property which is typically at the beginning of the file. https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00
* Add text/x-crystalGeopJr2021-05-282-0/+3
|
* adding org-modeGiovanni Alfredo Garciliano Díaz2021-05-272-0/+18
|
* text/x-python3: add *.pyi glob (Python stub files)Illia Volochii2021-05-272-0/+2
| | | | | | | | | | Stub files are files containing type hints, they are written in normal Python 3 syntax, but generally leaving out runtime logic like variable initializers, function bodies, and default arguments. https://www.python.org/dev/peps/pep-0484/#stub-files https://mypy.readthedocs.io/en/stable/stubs.html#stub-file-syntax
* image/x-xpixmap: add XPM2 magicVille Skyttä2021-05-132-0/+13
| | | | https://en.wikipedia.org/wiki/X_PixMap#XPM2
* application/x-troff-man: add *.[1-9] globVille Skyttä2021-05-131-0/+1
|
* application/toml: new typeVille Skyttä2021-05-122-0/+25
| | | | | | https://toml.io/en/v1.0.0#mime-type Closes https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/156
* Lower priority of "BEGIN {" for perl, awk uses that toowork/dfaure/issue155David Faure2021-04-252-0/+4
| | | | Closes https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/155
* application/x-7z-compressed: add *.7z.001 globVille Skyttä2021-02-242-0/+1
| | | | These are the first files of a multivolume archive.
* image/x-nikon-nrw: add test caseVille Skyttä2021-02-072-0/+2
| | | | https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/124#note_788636
* application/ovf: newVille Skyttä2021-01-132-0/+3
| | | | https://en.wikipedia.org/wiki/Open_Virtualization_Format
* application/x-qed-disk: newVille Skyttä2021-01-132-0/+2
| | | | https://wiki.qemu.org/Features/QED
* application/x-vdi-disk: newVille Skyttä2021-01-132-0/+2
| | | | https://en.wikipedia.org/wiki/VirtualBox#VirtualBox_Disk_Image
* application/x-vmdk-disk: newVille Skyttä2021-01-132-0/+2
| | | | https://en.wikipedia.org/wiki/VMDK
* application/x-vhd-disk, /x-vhdx-disk: newVille Skyttä2021-01-133-1/+5
| | | | https://en.wikipedia.org/wiki/VHD_(file_format)
* application/vnd.apple.numbers, .pages: add older magics and test casesVille Skyttä2021-01-103-0/+4
| | | | | Numbers 3.5 and Pages 5.5 appear to place an Index/Document.iwa, not index.xml there.
* Add text/x-dartJan Tojnar2021-01-102-0/+6
| | | | | | Dart is a programming language by Google. https://dart.dev/
* text/x-python: add text/x-modelica false positive test casework/scop/python-modelica-false-positiveVille Skyttä2020-12-312-0/+9
| | | | | | Fixed by https://gitlab.freedesktop.org/xdg/xdgmime/-/merge_requests/3 Closes https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/127
* audio/mpeg: add layer 2, 2.5, and 1 protected magicsmasato2020-12-308-1/+14
| | | | Closes https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/46