Skip to content

Commit

Permalink
Add support for XCF (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
somebody1234 committed Apr 17, 2021
1 parent 7021d9a commit 6ab25f3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core.d.ts
Expand Up @@ -10,6 +10,7 @@ declare namespace core {
| 'gif'
| 'webp'
| 'flif'
| 'xcf'
| 'cr2'
| 'cr3'
| 'orf'
Expand Down Expand Up @@ -146,6 +147,7 @@ declare namespace core {
| 'image/gif'
| 'image/webp'
| 'image/flif'
| 'image/x-xcf'
| 'image/x-canon-cr2'
| 'image/x-canon-cr3'
| 'image/tiff'
Expand Down
7 changes: 7 additions & 0 deletions core.js
Expand Up @@ -1051,6 +1051,13 @@ async function _fromTokenizer(tokenizer) {
};
}

if (checkString('gimp xcf ')) {
return {
ext: 'xcf',
mime: 'image/x-xcf'
};
}

// -- 12-byte signatures --

if (check([0x49, 0x49, 0x55, 0x00, 0x18, 0x00, 0x00, 0x00, 0x88, 0xE7, 0x74, 0xD8])) {
Expand Down
Binary file added fixture/fixture.xcf
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -54,6 +54,7 @@
"gif",
"webp",
"flif",
"xcf",
"cr2",
"cr3",
"orf",
Expand Down
1 change: 1 addition & 0 deletions readme.md
Expand Up @@ -278,6 +278,7 @@ Returns a set of supported MIME types.
- [`gif`](https://en.wikipedia.org/wiki/GIF) - Graphics Interchange Format
- [`webp`](https://en.wikipedia.org/wiki/WebP) - Web Picture format
- [`flif`](https://en.wikipedia.org/wiki/Free_Lossless_Image_Format) - Free Lossless Image Format
- [`xcf`](https://en.wikipedia.org/wiki/XCF_(file_format)) - eXperimental Computing Facility
- [`cr2`](https://fileinfo.com/extension/cr2) - Canon Raw image file (v2)
- [`cr3`](https://fileinfo.com/extension/cr3) - Canon Raw image file (v3)
- [`orf`](https://en.wikipedia.org/wiki/ORF_format) - Olympus Raw image file
Expand Down
2 changes: 2 additions & 0 deletions supported.js
Expand Up @@ -8,6 +8,7 @@ module.exports = {
'gif',
'webp',
'flif',
'xcf',
'cr2',
'cr3',
'orf',
Expand Down Expand Up @@ -144,6 +145,7 @@ module.exports = {
'image/gif',
'image/webp',
'image/flif',
'image/x-xcf',
'image/x-canon-cr2',
'image/x-canon-cr3',
'image/tiff',
Expand Down

0 comments on commit 6ab25f3

Please sign in to comment.