WordPerfect text and graphics file
application/octet-stream
Magic Bytes
Offset: 0
FF D8
The WordPerfect Text and Graphics (WPG) format is a proprietary vector and bitmap image container developed by Corel for its office suite. This legacy format primarily stores illustrations, clipart, and charts designed for embedding within word processing documents or digital presentations. Although now largely obsolete and replaced by universal standards like SVG or PNG, the format remains compatible with modern Corel software and various specialized conversion tools.
Validation Code
How to validate .wpg files in Python
Python
def is_wpg(file_path: str) -> bool:
"""Check if file is a valid WPG by magic bytes."""
signature = bytes([0xFF, 0xD8])
with open(file_path, "rb") as f:
return f.read(2) == signature
How to validate .wpg files in Node.js
Node.js
function isWPG(buffer: Buffer): boolean {
const signature = Buffer.from([0xFF, 0xD8]);
return buffer.subarray(0, 2).equals(signature);
}
Go
func IsWPG(data []byte) bool {
signature := []byte{0xFF, 0xD8}
if len(data) < 2 {
return false
}
return bytes.Equal(data[:2], signature)
}
API Endpoint
GET
/api/v1/wpg
curl https://filesignature.org/api/v1/wpg