Skip to content

Commit 6ab25f3

Browse files
authored
Add support for XCF (#450)
1 parent 7021d9a commit 6ab25f3

File tree

6 files changed

+13
-0
lines changed

6 files changed

+13
-0
lines changed

core.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ declare namespace core {
1010
| 'gif'
1111
| 'webp'
1212
| 'flif'
13+
| 'xcf'
1314
| 'cr2'
1415
| 'cr3'
1516
| 'orf'
@@ -146,6 +147,7 @@ declare namespace core {
146147
| 'image/gif'
147148
| 'image/webp'
148149
| 'image/flif'
150+
| 'image/x-xcf'
149151
| 'image/x-canon-cr2'
150152
| 'image/x-canon-cr3'
151153
| 'image/tiff'

core.js

+7
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,13 @@ async function _fromTokenizer(tokenizer) {
10511051
};
10521052
}
10531053

1054+
if (checkString('gimp xcf ')) {
1055+
return {
1056+
ext: 'xcf',
1057+
mime: 'image/x-xcf'
1058+
};
1059+
}
1060+
10541061
// -- 12-byte signatures --
10551062

10561063
if (check([0x49, 0x49, 0x55, 0x00, 0x18, 0x00, 0x00, 0x00, 0x88, 0xE7, 0x74, 0xD8])) {

fixture/fixture.xcf

78 KB
Binary file not shown.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"gif",
5555
"webp",
5656
"flif",
57+
"xcf",
5758
"cr2",
5859
"cr3",
5960
"orf",

readme.md

+1
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ Returns a set of supported MIME types.
278278
- [`gif`](https://en.wikipedia.org/wiki/GIF) - Graphics Interchange Format
279279
- [`webp`](https://en.wikipedia.org/wiki/WebP) - Web Picture format
280280
- [`flif`](https://en.wikipedia.org/wiki/Free_Lossless_Image_Format) - Free Lossless Image Format
281+
- [`xcf`](https://en.wikipedia.org/wiki/XCF_(file_format)) - eXperimental Computing Facility
281282
- [`cr2`](https://fileinfo.com/extension/cr2) - Canon Raw image file (v2)
282283
- [`cr3`](https://fileinfo.com/extension/cr3) - Canon Raw image file (v3)
283284
- [`orf`](https://en.wikipedia.org/wiki/ORF_format) - Olympus Raw image file

supported.js

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
'gif',
99
'webp',
1010
'flif',
11+
'xcf',
1112
'cr2',
1213
'cr3',
1314
'orf',
@@ -144,6 +145,7 @@ module.exports = {
144145
'image/gif',
145146
'image/webp',
146147
'image/flif',
148+
'image/x-xcf',
147149
'image/x-canon-cr2',
148150
'image/x-canon-cr3',
149151
'image/tiff',

0 commit comments

Comments
 (0)