GNU Image Manipulation Program
image/x-xcf
Magic Bytes
Offset: 0
67 69 6D 70 20 78 63 66 20
The eXperimental Computing Facility (XCF) format is the native image format of the GNU Image Manipulation Program (GIMP), maintained by the GIMP Development Team. It is primarily used for saving complex digital editing projects, as it preserves layers, paths, and transparency data without any quality degradation. Although generally considered a safe format for exchange, users should utilize trusted software versions to mitigate any vulnerabilities associated with parsing its complex, multi-layered data structure.
Validation Code
How to validate .xcf files in Python
Python
def is_xcf(file_path: str) -> bool:
"""Check if file is a valid XCF by magic bytes."""
signature = bytes([0x67, 0x69, 0x6D, 0x70, 0x20, 0x78, 0x63, 0x66, 0x20])
with open(file_path, "rb") as f:
return f.read(9) == signature
How to validate .xcf files in Node.js
Node.js
function isXCF(buffer: Buffer): boolean {
const signature = Buffer.from([0x67, 0x69, 0x6D, 0x70, 0x20, 0x78, 0x63, 0x66, 0x20]);
return buffer.subarray(0, 9).equals(signature);
}
Go
func IsXCF(data []byte) bool {
signature := []byte{0x67, 0x69, 0x6D, 0x70, 0x20, 0x78, 0x63, 0x66, 0x20}
if len(data) < 9 {
return false
}
return bytes.Equal(data[:9], signature)
}
API Endpoint
GET
/api/v1/xcf
curl https://filesignature.org/api/v1/xcf