Expand description
File type detection engine following ExifTool’s implementation
This module implements ExifTool’s sophisticated multi-tiered file type detection approach, ported from ExifTool.pm:2913-2999
Detection Flow:
- Extension-based candidates (via generated fileTypeLookup)
- Magic number validation (via generated magicNumber patterns)
- Last-ditch embedded signature recovery
The implementation preserves ExifTool’s exact logic including:
- Weak magic types that defer to extension
- Extension normalization rules
- Conflict resolution patterns
- Error recovery mechanisms
Structs§
- File
Type Detection Result - File
Type Detector - Main file type detector implementing ExifTool’s detection algorithm