Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for format .drc, Google's Draco 3D Data Compression #702

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,13 @@ export class FileTypeParser {
};
}

if (this.checkString('DRACO')) {
return {
ext: 'drc',
mime: 'application/vnd.google.draco', // Invented by us
};
}

// -- 6-byte signatures --

if (this.check([0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00])) {
Expand Down
Binary file added fixture/fixture-cube_pc.drc
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@
"fbx",
"vsdx",
"vtt",
"apk"
"apk",
"drc"
],
"dependencies": {
"strtok3": "^10.0.0",
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ abortController.abort(); // Abort file-type reading from the Blob stream.
- [`dmg`](https://en.wikipedia.org/wiki/Apple_Disk_Image) - Apple Disk Image
- [`dng`](https://en.wikipedia.org/wiki/Digital_Negative) - Adobe Digital Negative image file
- [`docx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Word document
- [`drc`](https://en.wikipedia.org/wiki/Zstandard) - Google's Draco 3D Data Compression
- [`dsf`](https://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf) - Sony DSD Stream File (DSF)
- [`dwg`](https://en.wikipedia.org/wiki/.dwg) - Autodesk CAD file
- [`elf`](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format) - Unix Executable and Linkable Format
Expand Down
2 changes: 2 additions & 0 deletions supported.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export const extensions = [
'vsdx',
'vtt',
'apk',
'drc',
];

export const mimeTypes = [
Expand Down Expand Up @@ -307,4 +308,5 @@ export const mimeTypes = [
'application/x.autodesk.fbx', // Invented by us
'application/vnd.visio',
'application/vnd.android.package-archive',
'application/vnd.google.draco', // Invented by us
];
3 changes: 3 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ const names = {
dng: [
'fixture-Leica-M10',
],
drc: [
'fixture-cube_pc',
],
epub: [
'fixture',
'fixture-crlf',
Expand Down
Loading