{"repo":"h2non/filetype","free":true,"listed":false,"github":"https://github.com/h2non/filetype","clone":"git clone https://github.com/h2non/filetype.git","description":"Fast, dependency-free Go package to infer binary file types based on the magic numbers header signature","language":"Go","stars":2296,"topics":["magic-numbers","filetype","mime","mime-types","discovery","lookup","magic-number","extension","validation","binary"],"license":"MIT","category":"dev-tools","readme_excerpt":"filetype Small and dependency free Go package to infer file and MIME type checking the magic numbers signature. For SVG file type checking, see go-is-svg package. Python port: filetype.py. Features - Supports a wide range of file types - Provides file extension and proper MIME type - File discovery by extension or MIME type - File discovery by class (image, video, audio...) - Provides a bunch of helpers and file matching shortcuts - Pluggable: add custom new types and matchers - Simple and semantic API - Blazing fast, even processing large files - Only first 262 bytes representing the max file header is required, so you can just pass a slice - Dependency free (just Go code, no C compilation needed) - Cross-platform file recognition Installation API See Godoc reference. Subpackages - github.com/h2non/filetype/types - github.com/h2non/filetype/matchers Examples Simple file type checking Check type class Supported type File header Add additional file type matchers Supported types Image - jpg - image/jpeg - png - image/png - gif - image/gif - webp - image/webp - cr2 - image/x-canon-cr2 - tif - image/tiff - bmp - image/bmp - heif - image/heif - jxr - image/vnd.ms-photo - psd - image/vnd.adobe.photoshop - ico - image/vnd.microsoft.icon - dwg - image/vnd.dwg - avif - image/avif Video - mp4 - video/mp4 - m4v - video/x-m4v - mkv - video/x-matroska - webm - video/webm - mov - video/quicktime - avi - video/x-msvideo - wmv - video/x-ms-wmv - mpg - video/mpeg - flv - video/x-flv - 3gp - v","default_branch":null,"files":null,"tree":[],"storefront":"/r/h2non","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/h2non/filetype/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}