diff --git a/core.d.ts b/core.d.ts index ba3142dd..f79f7b7b 100644 --- a/core.d.ts +++ b/core.d.ts @@ -151,6 +151,7 @@ export type FileExtension = | 'cpio' | 'ace' | 'avro' + | 'icc' ; // eslint-disable-line semi-style export type MimeType = @@ -298,6 +299,7 @@ export type MimeType = | 'application/x-cpio' | 'application/x-ace-compressed' | 'application/avro' + | 'application/vnd.iccprofile' ; // eslint-disable-line semi-style export type FileTypeResult = { diff --git a/core.js b/core.js index 843ad9ea..9a2cb2ac 100644 --- a/core.js +++ b/core.js @@ -1311,6 +1311,13 @@ class FileTypeParser { // Increase sample size from 12 to 256. await tokenizer.peekBuffer(this.buffer, {length: Math.min(256, tokenizer.fileInfo.size), mayBeLess: true}); + if (this.check([0x61, 0x63, 0x73, 0x70], {offset: 36})) { + return { + ext: 'icc', + mime: 'application/vnd.iccprofile', + }; + } + // -- 15-byte signatures -- if (this.checkString('BEGIN:')) { diff --git a/fixture/fixture.icc b/fixture/fixture.icc new file mode 100644 index 00000000..5841b46f Binary files /dev/null and b/fixture/fixture.icc differ diff --git a/package.json b/package.json index dee61737..d0bc8de5 100644 --- a/package.json +++ b/package.json @@ -203,7 +203,8 @@ "arj", "cpio", "ace", - "avro" + "avro", + "icc" ], "dependencies": { "readable-web-to-node-stream": "^3.0.2", diff --git a/readme.md b/readme.md index 5b2d24b8..cd50d930 100644 --- a/readme.md +++ b/readme.md @@ -366,6 +366,7 @@ Returns a `Set` of supported MIME types. - [`glb`](https://github.com/KhronosGroup/glTF) - GL Transmission Format - [`gz`](https://en.wikipedia.org/wiki/Gzip) - Archive file - [`heic`](https://nokiatech.github.io/heif/technical.html) - High Efficiency Image File Format +- [`icc`](https://en.wikipedia.org/wiki/ICC_profile) - ICC Profile - [`icns`](https://en.wikipedia.org/wiki/Apple_Icon_Image_format) - Apple Icon image - [`ico`](https://en.wikipedia.org/wiki/ICO_(file_format)) - Windows icon file - [`ics`](https://en.wikipedia.org/wiki/ICalendar#Data_format) - iCalendar diff --git a/supported.js b/supported.js index 42b45c49..6b2545f9 100644 --- a/supported.js +++ b/supported.js @@ -148,6 +148,7 @@ export const extensions = [ 'cpio', 'ace', 'avro', + 'icc', ]; export const mimeTypes = [ @@ -295,4 +296,5 @@ export const mimeTypes = [ 'application/x-cpio', 'application/x-ace-compressed', 'application/avro', + 'application/vnd.iccprofile', ];