6 releases (3 stable)
1.2.0 | Feb 23, 2024 |
---|---|
1.1.1 |
|
0.2.0 | Feb 18, 2024 |
0.1.1 | Feb 15, 2024 |
#563 in Parser implementations
60 downloads per month
160KB
3.5K
SLoC
Nom-Exif
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 thanRead
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
- Images
- Videos
- examples
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