exiftool-rs 0.5.0

Read, write, and edit metadata in 93 file formats — a pure Rust reimplementation of ExifTool 13.53 with 100% tag name parity (194/194 test files)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Write a tag to a file.
//!
//! Usage: cargo run --example write_tag -- input.jpg output.jpg Artist "John Doe"

fn main() {
    let args: Vec<String> = std::env::args().collect();
    if args.len() < 5 {
        eprintln!("Usage: {} <input> <output> <tag> <value>", args[0]);
        std::process::exit(1);
    }

    let mut et = exiftool_rs::ExifTool::new();
    et.set_new_value(&args[3], Some(&args[4]));
    match et.write_info(&args[1], &args[2]) {
        Ok(count) => println!("{} tag(s) written to {}", count, args[2]),
        Err(e) => eprintln!("Error: {}", e),
    }
}