JPX
application/octet-stream
Magic Bytes
Offset: 0
00 00 00 0C 6A 50 20 20 0D 0A 87 0A
JPX is an extended raster image format defined in Part 2 of the JPEG 2000 standard, developed by the Joint Photographic Experts Group. It supports advanced capabilities such as multiple composition layers, animation, and complex color spaces, frequently utilized in medical imaging and geospatial mapping applications. While offering richer functionality than the base JP2 format, it remains a standard static image container that is considered safe for general use.
Validation Code
How to validate .jpx files in Python
Python
def is_jpx(file_path: str) -> bool:
"""Check if file is a valid JPX by magic bytes."""
signature = bytes([0x00, 0x00, 0x00, 0x0C, 0x6A, 0x50, 0x20, 0x20, 0x0D, 0x0A, 0x87, 0x0A])
with open(file_path, "rb") as f:
return f.read(12) == signature
How to validate .jpx files in Node.js
Node.js
function isJPX(buffer: Buffer): boolean {
const signature = Buffer.from([0x00, 0x00, 0x00, 0x0C, 0x6A, 0x50, 0x20, 0x20, 0x0D, 0x0A, 0x87, 0x0A]);
return buffer.subarray(0, 12).equals(signature);
}
Go
func IsJPX(data []byte) bool {
signature := []byte{0x00, 0x00, 0x00, 0x0C, 0x6A, 0x50, 0x20, 0x20, 0x0D, 0x0A, 0x87, 0x0A}
if len(data) < 12 {
return false
}
return bytes.Equal(data[:12], signature)
}
API Endpoint
GET
/api/v1/jpx
curl https://filesignature.org/api/v1/jpx