UNPKG
is-xcf
Version:
latest (0.0.8)
0.0.8
0.0.7
0.0.6
0.0.4
0.0.3
0.0.2
0.0.1
Check if a buffer/Uint8Array is an XCF image
github.com/pskupinski/is-xcf
pskupinski/is-xcf
is-xcf
/
index.js
15 lines
(13 loc)
•
350 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'use strict'
;
module
.
exports
=
function
(
buf
) {
if
(!buf || buf.
length
<
8
)
return
false
;
// gimp xcf files start with "gimp xcf"
return
buf[
0
] ===
103
&& buf[
1
] ===
105
&& buf[
2
] ===
109
&& buf[
3
] ===
112
&& buf[
4
] ===
32
&& buf[
5
] ===
120
&& buf[
6
] ===
99
&& buf[
7
] ===
102
; };