Skip to content

Releases: velocityzen/FileType

2.2.1

Choose a tag to compare

@velocityzen velocityzen released this 21 Jun 19:18
2dd39f2

🐛 Fixes

  • Fixed Linux build failure when used alongside ZIPFoundation (or any other zlib-based package).
    FileType's internal zlib system module was named CZlib — the same name ZIPFoundation uses for its
    own zlib wrapper. With both packages in the same Swift Package Manager dependency graph, the Linux
    toolchain rejected the duplicate module with error: redefinition of module 'CZlib' and aborted the
    build. (macOS tolerated the collision, so this only surfaced on Linux.) The module has been renamed
    to FTZlib so it can no longer clash with other packages that wrap zlib.

2.2.0

Choose a tag to compare

@velocityzen velocityzen released this 14 Mar 20:47
19c42ca

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

Choose a tag to compare

@velocityzen velocityzen released this 14 Mar 14:00
fa11039

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

Choose a tag to compare

@velocityzen velocityzen released this 14 Mar 03:21
575015c

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

Choose a tag to compare

@velocityzen velocityzen released this 04 Jun 02:16

Improve epub detection

1.1.1

Choose a tag to compare

@velocityzen velocityzen released this 28 May 23:57

Fix mkv and webm support

1.1.0

Choose a tag to compare

@velocityzen velocityzen released this 19 Feb 00:55

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

Add asar support

Choose a tag to compare

@velocityzen velocityzen released this 21 Oct 02:13
1.0.4

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