#exif #nom #video #parser #jpeg #image #metadata

nom-exif

Exif/metadata parsing library written in pure Rust, both JPEG/HEIF/HEIC images and MOV/MP4 videos are supported

12 releases (stable)

1.2.6 Jul 13, 2024
1.2.4 Jul 12, 2024
1.2.0 Feb 23, 2024
0.2.0 Feb 18, 2024
0.1.1 Feb 15, 2024

#296 in Parser implementations

Download history 35/week @ 2024-03-30 10/week @ 2024-04-06 4/week @ 2024-04-20 66/week @ 2024-04-27 248/week @ 2024-05-04 191/week @ 2024-05-11 284/week @ 2024-05-18 313/week @ 2024-05-25 213/week @ 2024-06-01 188/week @ 2024-06-08 129/week @ 2024-06-15 165/week @ 2024-06-22 264/week @ 2024-06-29 934/week @ 2024-07-06 488/week @ 2024-07-13

1,876 downloads per month
Used in phorg

Custom license

165KB
4K SLoC

Nom-Exif

crates.io Documentation LICENSE CI

Exif/metadata parsing library written in pure Rust with nom.

Supported File Types

  • Images
    • JPEG
    • HEIF/HEIC
  • Videos
    • MOV
    • MP4

Features

  • Zero-copy when appropriate: Use borrowing and slicing instead of copying whenever possible.
  • Minimize I/O operations: When metadata is stored at the end/middle of a large file (such as a MOV/HEIC file does), Seek rather than Read to quickly locate the location of the metadata.
  • Pay as you go: When extracting Exif data, only the information corresponding to the specified Exif tags are parsed to reduce the overhead when processing a large number of files.
  • Robustness and stability: Through long-term Fuzz testing, and tons of crash issues discovered during testing have been fixed. Thanks to @sigaloid for pointing this out!

Usage

CLI Tool rexiftool

Normal output

cargo run --example rexiftool testdata/meta.mov:

com.apple.quicktime.make                => Apple
com.apple.quicktime.model               => iPhone X
com.apple.quicktime.software            => 12.1.2
com.apple.quicktime.location.ISO6709    => +27.1281+100.2508+000.000/
com.apple.quicktime.creationdate        => 2019-02-12T15:27:12+08:00
duration                                => 500
width                                   => 720
height                                  => 1280

Json dump

cargo run --features json_dump --example rexiftool -- -j testdata/meta.mov:

{
  "height": "1280",
  "duration": "500",
  "width": "720",
  "com.apple.quicktime.creationdate": "2019-02-12T15:27:12+08:00",
  "com.apple.quicktime.make": "Apple",
  "com.apple.quicktime.model": "iPhone X",
  "com.apple.quicktime.software": "12.1.2",
  "com.apple.quicktime.location.ISO6709": "+27.1281+100.2508+000.000/"
}

Changelog

CHANGELOG.md

Dependencies

~4.5–6.5MB
~111K SLoC