mimetype

A fast Golang library for media type and file extension detection, based on magic numbers

MIT License

Stars
1.4K
Committers
58

Bot releases are hidden (Show)

mimetype - v1.4.3 Latest Release

Published by gabriel-vasile about 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/gabriel-vasile/mimetype/compare/v1.4.2...v1.4.3

mimetype - v1.4.2

Published by gabriel-vasile over 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/gabriel-vasile/mimetype/compare/v1.4.1...v1.4.2

mimetype - v1.4.2-rc1

Published by gabriel-vasile over 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/gabriel-vasile/mimetype/compare/v1.4.1...v1.4.2-rc1

mimetype - v1.4.1

Published by gabriel-vasile over 2 years ago

What's Changed

Security fixes

New detected formats

Bug fixes

New Contributors

Full Changelog: https://github.com/gabriel-vasile/mimetype/compare/v1.4.0...v1.4.1

mimetype - v1.4.1-rc1

Published by gabriel-vasile over 2 years ago

New Detected Formats

.png, image/vnd.mozilla.apng
.ttc, font/collection
.avif, image/avif
.srt, application/x-subrip, alias: application/x-srt, text/x-srt
.vtt, text/vtt

What's Changed

New Contributors

Full Changelog: https://github.com/gabriel-vasile/mimetype/compare/v1.4.0...v1.4.1-rc1

mimetype - v1.4.0

Published by gabriel-vasile about 3 years ago

Features:

  • support for 3 new formats: .msi, .har, .jxl; #182, #174, #154
  • possibility to Extend individual MIME nodes #158

Fixes:

  • exclude weird control characters from valid UTF8 #186
  • rename x-sqlite3 to vnd.sqlite3 #170
  • single JSON value are no longer detected as JSON #175
  • fix vint-width parsing in matroska #185

Thank you for your contributions @ne1llee, @waybackarchiver, @jonsneyers, @sigma, @anthonyfok, @dennisstritzke, @IevgenLuzan, @Kycklingar.

mimetype - Fix EOF returned for empty readers

Published by gabriel-vasile over 3 years ago

v1.2.0 introduced a change where error EOF was returned for empty readers.
Previously, text/plain would be returned for such an input.

v1.3.1 comes back to the pre-v1.2.0 behavior.

mimetype - Add Extend functionality and support for .lnk and .xpm formats

Published by gabriel-vasile over 3 years ago

Add Extend function. It allows users to detect other file formats not detected by mimetype. See example for usage.

New supported formats:

  • .lnk application/x-ms-shortcut
  • .xpm image/x-xpixmap

Fixes:

  • #152 Check for zip header in chrome extensions
  • #145 Add support for other text encodings/charsets
mimetype - Add SetLimit function and support for 5 other formats

Published by gabriel-vasile over 3 years ago

Add SetLimit function. It lets users set the length of the header mimetype reads from the input. Longer headers give better detection results for file formats that keep their magic numbers towards the end of the file.

New supported formats:

  • OWL application/owl+xml
  • SXC application/vnd.sun.xml.calc
  • HDR image/vnd.radiance
  • ODC application/x-vnd.oasis.opendocument.chart
  • GLB model/gltf-binary
mimetype - Add support for several formats

Published by gabriel-vasile almost 4 years ago

Add support for:

  • Adobe FDF
  • Adobe XFDF
  • P7S
  • M3U
  • CPIO
  • TZIF
  • Outlook MSG
  • GIMP XCF
  • GIMP PAT
  • GIMP GBR
mimetype - Add torrent and rmvb support

Published by gabriel-vasile over 4 years ago

Add support for torrent and rmvb files.
Ease docx, xlsx and pptx detection for trailing signatures.

mimetype - Add EqualsAny function

Published by gabriel-vasile over 4 years ago

mimetype - Add lzip support

Published by gabriel-vasile over 4 years ago

mimetype - Add support for XZ and TTF files

Published by gabriel-vasile over 4 years ago

mimetype - Behave as http.DetectContentType and return text/plain for empty input

Published by gabriel-vasile over 4 years ago

mimetype - Fix panic in msoXML detection

Published by gabriel-vasile almost 5 years ago

Add check for input slice capacity in msoXML detection and extend the msoXML check from first 4 local headers to 6.

mimetype - Add support for Cabinet and UTF-16 files

Published by gabriel-vasile almost 5 years ago

Add support for:

  • application/vnd.ms-cab-compressed
  • text/plain; charset=utf-16le
  • text/plain; charset=utf-16be
mimetype - v1.0.0

Published by gabriel-vasile almost 5 years ago

In v1.x the detect functions no longer return the MIME type and extension as strings. Instead they return a MIME struct. To get the string value of the MIME and the extension, call the String() and the Extension() methods.

In order to play better with the stdlib mime package, v1.x file extensions include the leading dot, as in ".html".

In v1.x the text/plain MIME type is text/plain; charset=utf-8.

mimetype - Improve mso xml files detection

Published by gabriel-vasile almost 5 years ago

mimetype - Add support for PUB, MDB and ACCDB file formats

Published by gabriel-vasile almost 5 years ago

Add support for:

  • .pub
  • .mdb and .accdb

Fix heic and heif extensions.