PackageTrack
Sign in Get early access

file_magic_number

A Flutter package to detect file types based on their magic number instead of MIME types. Supports Flutter on mobile, desktop, and web without native code.

2.1.0 8.9K downloads/mo #3078 most downloaded on pub.dev vicajilau/file_magic_number

What this package is like to depend on

Last release 1 months ago

16 Jul 2026

Release timing varies

gaps range from 2 weeks to 7 months

Nearly every release is documented

notes for 26 of 26 stable releases

Nothing withdrawn

no release was ever pulled

2 years old

26 releases · first in 2025

4 releases in the last 12 months

see the full history below

Release timeline

26 releases · Feb 2025 to Jul 2026
2026
Release Pre-release

Releases

latest 26
  1. 2.1.0 16 Jul 2026
    Release notes

    What's Changed

    • Bump actions/checkout from 4 to 7 by @dependabot[bot] in #39
    • Bump codecov/codecov-action from 5 to 7 by @dependabot[bot] in #40
    • Bump file_magic_number from 1.4.2 to 2.0.0 in /example by @dependabot[bot] in #42
    • Bump mime from 1.0.6 to 2.0.0 by @dependabot[bot] in #41
    • feat: memory optimization, new formats, and dynamic custom type registration by @vicajilau in #44

    Full Changelog: v2.0.0...v2.1.0

    Open source →
    Release notes
    • Dependency Upgrade: Upgraded mime dependency to version ^2.0.0, resolving version resolution conflicts with Firebase packages and pdf_combiner.
    • Performance Optimization: Optimized detectFileTypeFromPathOrBlob to read only the first chunk of bytes (up to 512 bytes) using stream reading. This prevents high memory usage (OOM errors) and significantly improves detection speeds for large files.
    • New Formats: Added support for Gzip (.gz), Ogg (.ogg / .ogv), and FLAC (.flac) file detection.
    • Dynamic Custom Types: Added FileMagicNumber.registerCustomType to allow clients to dynamically register custom extensions, MIME types, and magic numbers from their code.
    • Internal Cleanup: Utilized and integrated stream reading extensions safely across platforms.
    Open source →
  2. 2.0.0 27 Jun 2026
    Release notes

    What's Changed

    • Bump file_picker from 10.3.7 to 10.3.8 in /example by @dependabot[bot] in #33
    • Bump file_picker from 10.3.8 to 10.3.10 in /example by @dependabot[bot] in #34
    • Bump cupertino_icons from 1.0.8 to 1.0.9 in /example by @dependabot[bot] in #35
    • Bump file_picker from 10.3.10 to 11.0.1 in /example by @dependabot[bot] in #36
    • Bump file_picker from 11.0.1 to 11.0.2 in /example by @dependabot[bot] in #37
    • Bump desktop_drop from 0.7.0 to 0.7.1 in /example by @dependabot[bot] in #38

    Full Changelog: v1.4.2...v2.0.0

    Open source →
    Release notes
    • Breaking change: Added new file types to FileMagicNumberType enum (docx, xlsx, pptx, html, json, xml, csv, svg, txt, rtf, epub). Since enums are exhaustively matched in Dart 3, switch statements over this enum must handle the new types or define a default case.
    • Refactor & Internal Rewrite: Replaced custom parser logic and custom reader classes with a pure, cross-platform integration based on the standard mime package (MimeTypeResolver and lookupMimeType) and cross_file (XFile).
    • Bug Fixes: Fixed false positive issues where JPG or other files containing random byte sequences could match the offset-based signatures of MP4/HEIC.
    • Empty File Detection: Empty files are now instantly detected as FileMagicNumberType.emptyFile regardless of their path extension.
    Open source →
  3. 1.4.2 13 Dec 2025
    Release notes
    • Fixed an issue where MP4 files were not detected. #31.
    • Added new test about different complet file types with another files inside (ej: rar with tar)
    Open source →
    Release notes
    • Fixed an issue where MP4 files were not detected. #31.
    • Added new test about different complet file types with another files inside (ej: rar with tar)
    Open source →
  4. 1.4.1 21 Nov 2025
    Release notes
    • Fixed an error that confused a PDF with a JP2 image inside, with a JP2 file #27.
    • Added new test about pdfs with another files inside (ej: pdfs with jp2)
    Open source →
    Release notes
    • Fixed an error that confused a PDF with a JP2 image inside, with a JP2 file #27.
    • Added new test about pdfs with another files inside (ej: pdfs with jp2)
    Open source →
  5. 1.4.0 11 Jul 2025
    Release notes
    • Fixed an issue where JPEG files were detected as TIFF files #17.
    • Added webp support.
    • Added AVI support.
    • Improved WAV support.
    • Added magic number detection byRange.
    Open source →
    Release notes
    • Fixed an issue where JPEG files were detected as TIFF files #17.
    • Added webp support.
    • Added AVI support.
    • Improved WAV support.
    • Added magic number detection byRange.
    Open source →
  6. 1.3.2 19 Jun 2025
    Release notes
    • Fixed an issue where PDFA files were not detected.
    • Removed Cocoapods on example project.
    • Fixed an issue loading images on example project.
    • Improved file detection in dynamic magic numbers.
    Open source →
    Release notes
    • Fixed an issue where PDFA files were not detected.
    • Removed Cocoapods on example project.
    • Fixed an issue loading images on example project.
    • Improved file detection in dynamic magic numbers.
    Open source →
  7. 1.3.1 14 Apr 2025
    Release notes
    • Improved file detection.
    • Fixed some private methods that were publicly accessible.
    • Updated dependencies.
    Open source →
    Release notes
    • Improved file detection.
    • Reorganized code and update dependencies.
    Open source →
  8. 1.3.0 09 Apr 2025
    Release notes
    • Added HEIC (High Efficiency Image Coding) support, part of the HEIF (High Efficiency Image File) format.
    • Breaking change: Resolved an issue with imports where private files are exposed to be imported.
    • Individual files can be dragged and dropped on desktop apps and web app on example project.
    Open source →
    Release notes
    • Added HEIC (High Efficiency Image Coding) support, part of the HEIF (High Efficiency Image File) format.
    • Breaking change: Resolved an issue with imports where private files are exposed to be imported.
    • Individual files can be dragged and dropped on desktop apps and web app on example project.
    Open source →
  9. 1.2.2 23 Mar 2025
    Release notes
    • Updated documentation.
    • Updated dependencies from example project.
    • Removed cocoapods from example project.
    Open source →
    Release notes
    • Updated documentation.
    • Updated dependencies from example project.
    • Removed cocoapods from example project.
    Open source →
  10. 1.2.1 12 Mar 2025
    Release notes
    • Increased support for Dart from version 3.4.
    Open source →
    Release notes
    • Increased support for Dart from version 3.4.
    Open source →
  11. 1.2.0 09 Mar 2025
    Release notes
    • Updated example project dependencies
    • Improved tests
    • Improved example project flow and style
    • Added getBytesFromPathOrBlob method returning Uint8List object.
    Open source →
  12. 1.1.1 19 Feb 2025
    Release notes
    • Minor improvements.
    • Added more documentation.
    Open source →
  13. 1.1.0 19 Feb 2025
    Release notes
    • Added detectFileTypeFromPathOrBlob method.
    • Improved documentation.
    Open source →
  14. 1.0.0 19 Feb 2025
    Release notes
    • BREAKING CHANGE: MagicNumber has been renamed to FileMagicNumber.
    • BREAKING CHANGE: MagicNumberType has been renamed to FileMagicNumberType.
    • BREAKING CHANGE: detectFileType has been renamed to detectFileTypeFromBytes.
    Open source →
  15. 0.8.0 18 Feb 2025
    Release notes
    • Simplified CI.
    • Improved CD.
    • Fixed readme.
    • Migrated from Dart to Flutter package.
    Open source →
  16. 0.7.2 17 Feb 2025
    Release notes
    • Improved MagicNumberMatchType for offset and exact detection.
    • Clearer documentation improvements.
    Open source →
  17. 0.7.1 17 Feb 2025
    Release notes
    • Fixed documentation with file_pickerdependency.
    Open source →
  18. 0.7.0 16 Feb 2025
    Release notes
    • Fixed bytes in example project.
    • Fixed mp4 were not detected properly.
    • Created offset and regular file type detection.
    • Added MagicNumberMatchType for offset and exact detection.
    Open source →
  19. 0.6.0 16 Feb 2025
    Release notes
    • Added much more formats.
    • Improved documentation.
    • Simplified verification.
    • Added tests for each format.
    • Added debug utilities.
    • Very large files are shortened to the first few bytes to speed up the library. This means up to +10x faster on large files.
    Open source →
  20. 0.5.1 16 Feb 2025
    Release notes
    • Fixed image on pub.dev
    Open source →
  21. 0.5.0 16 Feb 2025
    Release notes
    • Added coverage in CI
    • Added more test
    • Improved readme
    • Created as Dart package
    Open source →
  22. 0.4.0 16 Feb 2025
    Release notes

    General

    • Update dependencies on example project.
    • Updated readme.
    Open source →
  23. 0.3.1 15 Feb 2025
    Release notes

    General

    • Some minor improvements.
    Open source →
  24. 0.3.0 15 Feb 2025
    Release notes

    General

    • Refactored structure.
    • BREAKING CHANGE: detectFileType use a Uint8List instead of a String as parameter doing it universal.

    Web

    • Added web development.
    Open source →
  25. 0.2.0 15 Feb 2025
    Release notes

    General

    • Example improvements.
    • BREAKING CHANGE: Returns MagicNumberType when detectFileType is called.
    Open source →
  26. 0.1.0 15 Feb 2025
    Release notes

    General

    • Added CI.
    • Added Example project.
    • Added Readme.
    • Added documentation.
    • Added test.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive