A command-line tool written in Rust that extracts metadata from JPEG images and outputs it as JSON files.
- Extracts filesystem metadata (filename, size, created_time, modified_time)
- Extracts EXIF metadata (orientation, capture_time, camera_model, camera_serial)
- Processes multiple files in a single command
- Outputs JSON files in the same directory as input images
- Omits unavailable metadata fields from output
cargo run -- image1.jpg image2.jpg image3.jpg
Or after building:
./target/release/jpeg-metadata-extractor image1.jpg image2.jpg image3.jpg
For each input file image.jpg
, a corresponding image.json
file will be created in the same directory containing the extracted metadata.
Example output:
{
"filename": "CAM18839.jpg",
"size": 1164980,
"created_time": "2020-08-13T10:57:06.773358405Z",
"modified_time": "2020-08-13T10:57:06.773358405Z",
"orientation": 1,
"capture_time": "2020-08-09T12:58:32",
"camera_model": "EOS 5D Mark IV",
"camera_serial": "025021000535"
}
cargo build --release
cargo test
kamadak-exif
- EXIF data parsingserde
&serde_json
- JSON serializationchrono
- Date/time handlingclap
- Command-line argument parsing