QOI
application/octet-stream
Magic Bytes
Offset: 0
71 6F 69 66
The QOI format is a low-complexity, lossless image compression standard created and maintained by developer Dominic Szablewski. This format is primarily utilized in game development and real-time graphics applications where high-speed encoding and decoding are prioritized over maximum compression ratios. Due to its minimal implementation requirements and straightforward specification, the format is considered highly secure against common parser vulnerabilities such as memory corruption or buffer overflows.
Validation Code
How to validate .qoi files in Python
Python
def is_qoi(file_path: str) -> bool:
"""Check if file is a valid QOI by magic bytes."""
signature = bytes([0x71, 0x6F, 0x69, 0x66])
with open(file_path, "rb") as f:
return f.read(4) == signature
How to validate .qoi files in Node.js
Node.js
function isQOI(buffer: Buffer): boolean {
const signature = Buffer.from([0x71, 0x6F, 0x69, 0x66]);
return buffer.subarray(0, 4).equals(signature);
}
Go
func IsQOI(data []byte) bool {
signature := []byte{0x71, 0x6F, 0x69, 0x66}
if len(data) < 4 {
return false
}
return bytes.Equal(data[:4], signature)
}
API Endpoint
GET
/api/v1/qoi
curl https://filesignature.org/api/v1/qoi