Skip to content

Commit 4b7eb75

Browse files
anatawa12Borewitsindresorhus
authored
Add support for FBX (Filmbox) (#605)
Co-authored-by: Borewit <Borewit@users.noreply.github.com> Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
1 parent f5b232c commit 4b7eb75

File tree

6 files changed

+14
-1
lines changed

6 files changed

+14
-1
lines changed

core.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ export type FileExtension =
153153
| 'ace'
154154
| 'avro'
155155
| 'icc'
156+
| 'fbx'
156157
; // eslint-disable-line semi-style
157158

158159
export type MimeType =
@@ -302,6 +303,7 @@ export type MimeType =
302303
| 'application/x-ace-compressed'
303304
| 'application/avro'
304305
| 'application/vnd.iccprofile'
306+
| 'application/x.autodesk.fbx'
305307
; // eslint-disable-line semi-style
306308

307309
export type FileTypeResult = {

core.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,13 @@ export class FileTypeParser {
15061506
};
15071507
}
15081508

1509+
if (this.checkString('Kaydara FBX Binary \u0000')) {
1510+
return {
1511+
ext: 'fbx',
1512+
mime: 'application/x.autodesk.fbx', // Invented by us
1513+
};
1514+
}
1515+
15091516
if (
15101517
this.check([0x4C, 0x50], {offset: 34})
15111518
&& (

fixture/fixture.fbx

16.6 KB
Binary file not shown.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@
206206
"cpio",
207207
"ace",
208208
"avro",
209-
"icc"
209+
"icc",
210+
"fbx"
210211
],
211212
"dependencies": {
212213
"readable-web-to-node-stream": "^3.0.2",

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ console.log(fileType);
405405
- [`f4b`](https://en.wikipedia.org/wiki/Flash_Video) - Audiobook and podcast ISO base media file format used by Adobe Flash Player
406406
- [`f4p`](https://en.wikipedia.org/wiki/Flash_Video) - ISO base media file format protected by Adobe Access DRM used by Adobe Flash Player
407407
- [`f4v`](https://en.wikipedia.org/wiki/Flash_Video) - ISO base media file format used by Adobe Flash Player
408+
- [`fbx`](https://en.wikipedia.org/wiki/FBX) - Filmbox is a proprietary file format used to provide interoperability between digital content creation apps.
408409
- [`flac`](https://en.wikipedia.org/wiki/FLAC) - Free Lossless Audio Codec
409410
- [`flif`](https://en.wikipedia.org/wiki/Free_Lossless_Image_Format) - Free Lossless Image Format
410411
- [`flv`](https://en.wikipedia.org/wiki/Flash_Video) - Flash video

supported.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export const extensions = [
150150
'ace',
151151
'avro',
152152
'icc',
153+
'fbx',
153154
];
154155

155156
export const mimeTypes = [
@@ -299,4 +300,5 @@ export const mimeTypes = [
299300
'application/x-ace-compressed',
300301
'application/avro',
301302
'application/vnd.iccprofile',
303+
'application/x.autodesk.fbx', // Invented by us
302304
];

0 commit comments

Comments
 (0)