Skip to content

Commit

Permalink
feat: autodesk fbx binary format support
Browse files Browse the repository at this point in the history
  • Loading branch information
anatawa12 committed Aug 7, 2023
1 parent e4204df commit 94dbe80
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions core.d.ts
Expand Up @@ -152,6 +152,7 @@ export type FileExtension =
| 'ace'
| 'avro'
| 'icc'
| 'fbx'
; // eslint-disable-line semi-style

export type MimeType =
Expand Down Expand Up @@ -300,6 +301,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 @@ -1433,6 +1433,13 @@ 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
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -204,7 +204,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 @@ -359,6 +359,7 @@ Returns a `Set<string>` of supported MIME types.
- [`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) - A model format used by many creation applicationAutodesk
- [`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 @@ -149,6 +149,7 @@ export const extensions = [
'ace',
'avro',
'icc',
'fbx',
];

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

0 comments on commit 94dbe80

Please sign in to comment.