0.2.0 (2026-04-21)
Custom signatures
- Define your own MIME types via
use MagicBytes.DefineSignaturesand wire them in withconfig :magic_bytes, extra_signatures: MyModule defsignature/2registers a prefix-based signatureguards: trueoption generates guard macros on the custom module (e.g.MyModule.is_application_x_cld/1)- Custom signatures are checked before built-ins; unmatched bytes fall through to built-in detection
Configuration
config :magic_bytes, read_bytes: N— bytes read from input; defaults to16, which satisfies all built-in signatures. Only needed if you define custom signatures whose prefix exceeds 16 bytes.config :magic_bytes, only: [...]— restrict detection to a specific set of MIME types; others return{:error, :unknown}config :magic_bytes, exclude: [...]— suppress specific MIME types
New built-in signatures
image/jp2(JPEG 2000)image/jxl(JPEG XL — bare codestream and ISO BMFF container)image/flifapplication/x-lz4application/vnd.apache.parquetapplication/vnd.apache.arrow.fileapplication/vnd.android.dex
0.1.0 (2026-04-09)
Initial release.
MagicBytes.from_path/1,from_binary/1,from_stream/1for MIME detection- Guard macros generated for all prefix-based signatures (
is_image_jpeg/1,is_application_pdf/1, etc.) - Support for 40+ MIME types across images, audio, video, documents, archives, executables, fonts, and databases