Skip to content

Commit

Permalink
Add support for FBX (Filmbox) (#605)
Browse files Browse the repository at this point in the history
Co-authored-by: Borewit <Borewit@users.noreply.github.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
  • Loading branch information
3 people committed Nov 10, 2023
1 parent f5b232c commit 4b7eb75
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions core.d.ts
Expand Up @@ -153,6 +153,7 @@ export type FileExtension =
| 'ace'
| 'avro'
| 'icc'
| 'fbx'
; // eslint-disable-line semi-style

export type MimeType =
Expand Down Expand Up @@ -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 = {
Expand Down
7 changes: 7 additions & 0 deletions core.js
Expand Up @@ -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})
&& (
Expand Down
Binary file added fixture/fixture.fbx
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -206,7 +206,8 @@
"cpio",
"ace",
"avro",
"icc"
"icc",
"fbx"
],
"dependencies": {
"readable-web-to-node-stream": "^3.0.2",
Expand Down
1 change: 1 addition & 0 deletions readme.md
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions supported.js
Expand Up @@ -150,6 +150,7 @@ export const extensions = [
'ace',
'avro',
'icc',
'fbx',
];

export const mimeTypes = [
Expand Down Expand Up @@ -299,4 +300,5 @@ export const mimeTypes = [
'application/x-ace-compressed',
'application/avro',
'application/vnd.iccprofile',
'application/x.autodesk.fbx', // Invented by us
];

0 comments on commit 4b7eb75

Please sign in to comment.