Skip to content

Releases: velocityzen/FileType

2.2.0

14 Mar 20:47
19c42ca

Choose a tag to compare

New Features

  • UTI-based file type detection — On Apple platforms, you can now detect file types directly from Uniform Type Identifier strings or UTType values using the new FileType.detect(uti:) and FileType.detect(utType:) APIs. Available when UniformTypeIdentifiers can 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 @available annotations.

2.1.0

14 Mar 14:00
fa11039

Choose a tag to compare

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

14 Mar 03:21
575015c

Choose a tag to compare

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 nil instead 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 FileTypeMIMEGroup enum lets you limit detection to a specific MIME major type (image, audio, video, etc.) via detect(in:matching:) and related APIs
  • Full-file detection — Detect file types via FileHandle and URL APIs 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 APIsdataRequirement(for:), minimumPrefixBytes(for:), canonicalFileExtension

Fixes

  • Registry files with LF line endings.reg detection 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

04 Jun 02:16

Choose a tag to compare

Improve epub detection

1.1.1

28 May 23:57

Choose a tag to compare

Fix mkv and webm support

1.1.0

19 Feb 00:55

Choose a tag to compare

Add: chm, 3mf, elf, jul, xcf, vcf, png, stl
Improve: xml, avif, mts, asf, ics, cfb, tar, pdf, ai

Add asar support

21 Oct 02:13

Choose a tag to compare

1.0.4

Make sure data is at least as large as the header size before attempt…