Releases: velocityzen/FileType
Releases · velocityzen/FileType
2.2.0
New Features
- UTI-based file type detection — On Apple platforms, you can now detect file types directly from Uniform Type Identifier strings or
UTTypevalues using the newFileType.detect(uti:)andFileType.detect(utType:)APIs. Available whenUniformTypeIdentifierscan be imported (macOS 11+, iOS 14+, tvOS 14+, watchOS 7+, visionOS 1+).
Improvements
- Platform and language configuration — Package now declares minimum platform versions and explicitly opts into Swift 6 language mode via
swiftLanguageModes: [.v6], removing the need for per-declaration@availableannotations.
2.1.0
New Features
- Streaming manifest detection — Detect HLS (
m3u), MPEG-DASH (mpd), and Microsoft Smooth Streaming (ism) manifest files. HLS detection distinguishes HLS-specific playlists from generic M3U files by checking for#EXT-X-tags.
2.0.0
Changes since 1.1.2
Breaking Changes
- Swift 6.2 required — Minimum swift-tools-version bumped to 6.2
- API renames — Several methods have been renamed (old names still available as deprecated aliases)
- Byte-reading helpers now return optionals — Bounds-checked reads return
nilinstead of crashing on out-of-range access
New Features
- 40+ new file formats — ACE, APK, ARJ, Avro, CPIO, DWG, FBX, ICC, J2C, JAR, JLS, JMP, LZ4, Mach-O, Parquet, PCAP, PST, RealMedia, SPSS SAV, TTC, VTT, WebP, and many more
- Expanded Office & ODF support — DOCM, DOTM, DOTX, POTM, POTX, PPSM, PPSX, PPTM, XLSM, XLTM, XLTX, ODG, OTG, OTP, OTS, OTT, VSDX
- MIME group filtering — New
FileTypeMIMEGroupenum lets you limit detection to a specific MIME major type (image, audio, video, etc.) viadetect(in:matching:)and related APIs - Full-file detection — Detect file types via
FileHandleandURLAPIs for formats that need more than a prefix
Improvements
- Rewritten ZIP-based detection — Parses central directory and inflates compressed entries for reliable Office/ODF identification
- Proper TIFF tag detection — ARW, CR2, NEF, and DNG detected via TIFF tag parsing instead of heuristics
- Better tar validation — Checksum-based tar detection
- Improved MPEG matching — More accurate MPEG header detection with ID3 header stripping
- Sendable conformances — All public types conform to
Sendable - New query APIs —
dataRequirement(for:),minimumPrefixBytes(for:),canonicalFileExtension
Fixes
- Registry files with LF line endings —
.regdetection now accepts both LF and CRLF line endings - 64-bit integer helpers — Fixed to correctly read all 8 bytes
- Corrupt MKV handling — Graceful handling of malformed MKV files
1.1.2
Improve epub detection
1.1.1
Fix mkv and webm support
1.1.0
Add: chm, 3mf, elf, jul, xcf, vcf, png, stl
Improve: xml, avif, mts, asf, ics, cfb, tar, pdf, ai
Add asar support
1.0.4 Make sure data is at least as large as the header size before attempt…