#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

6 releases (3 stable)

1.2.0 Feb 23, 2024
1.1.1 Feb 23, 2024
0.2.0 Feb 18, 2024
0.1.1 Feb 15, 2024

#563 in Parser implementations

Download history 195/week @ 2024-02-11 443/week @ 2024-02-18 81/week @ 2024-02-25 5/week @ 2024-03-03 32/week @ 2024-03-10 8/week @ 2024-03-17 43/week @ 2024-03-31 2/week @ 2024-04-07

60 downloads per month

Custom license

160KB
3.5K 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.

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/"
}

Dependencies

~4–6MB
~109K SLoC