diff --git a/core.d.ts b/core.d.ts index 37f06266..3fd0f9ac 100644 --- a/core.d.ts +++ b/core.d.ts @@ -153,6 +153,7 @@ export type FileExtension = | 'ace' | 'avro' | 'icc' + | 'fbx' ; // eslint-disable-line semi-style export type MimeType = @@ -302,6 +303,7 @@ export type MimeType = | 'application/x-ace-compressed' | 'application/avro' | 'application/vnd.iccprofile' + | 'application/x.autodesk.fbx' ; // eslint-disable-line semi-style export type FileTypeResult = { diff --git a/core.js b/core.js index 01dcb11e..6816f80f 100644 --- a/core.js +++ b/core.js @@ -1506,6 +1506,13 @@ export class FileTypeParser { }; } + if (this.checkString('Kaydara FBX Binary \u0000')) { + return { + ext: 'fbx', + mime: 'application/x.autodesk.fbx', // Invented by us + }; + } + if ( this.check([0x4C, 0x50], {offset: 34}) && ( diff --git a/fixture/fixture.fbx b/fixture/fixture.fbx new file mode 100644 index 00000000..12e963b9 Binary files /dev/null and b/fixture/fixture.fbx differ diff --git a/package.json b/package.json index c6c799da..c09f4fd5 100644 --- a/package.json +++ b/package.json @@ -206,7 +206,8 @@ "cpio", "ace", "avro", - "icc" + "icc", + "fbx" ], "dependencies": { "readable-web-to-node-stream": "^3.0.2", diff --git a/readme.md b/readme.md index 0451bbe5..da9276c8 100644 --- a/readme.md +++ b/readme.md @@ -405,6 +405,7 @@ console.log(fileType); - [`f4b`](https://en.wikipedia.org/wiki/Flash_Video) - Audiobook and podcast ISO base media file format used by Adobe Flash Player - [`f4p`](https://en.wikipedia.org/wiki/Flash_Video) - ISO base media file format protected by Adobe Access DRM used by Adobe Flash Player - [`f4v`](https://en.wikipedia.org/wiki/Flash_Video) - ISO base media file format used by Adobe Flash Player +- [`fbx`](https://en.wikipedia.org/wiki/FBX) - Filmbox is a proprietary file format used to provide interoperability between digital content creation apps. - [`flac`](https://en.wikipedia.org/wiki/FLAC) - Free Lossless Audio Codec - [`flif`](https://en.wikipedia.org/wiki/Free_Lossless_Image_Format) - Free Lossless Image Format - [`flv`](https://en.wikipedia.org/wiki/Flash_Video) - Flash video diff --git a/supported.js b/supported.js index 5b913777..e3344c4b 100644 --- a/supported.js +++ b/supported.js @@ -150,6 +150,7 @@ export const extensions = [ 'ace', 'avro', 'icc', + 'fbx', ]; export const mimeTypes = [ @@ -299,4 +300,5 @@ export const mimeTypes = [ 'application/x-ace-compressed', 'application/avro', 'application/vnd.iccprofile', + 'application/x.autodesk.fbx', // Invented by us ];