#exif #metadata #tiff #tag #gps

bin+lib rexif

RExif is a native Rust crate, written to extract EXIF data from JPEG and TIFF images

12 releases

0.5.1 Oct 31, 2020
0.5.0 Jan 27, 2020
0.4.1 Dec 26, 2019
0.3.7 Oct 25, 2019
0.3.1 Nov 9, 2015

#47 in Images

Download history 223/week @ 2020-08-13 238/week @ 2020-08-20 221/week @ 2020-08-27 204/week @ 2020-09-03 217/week @ 2020-09-10 361/week @ 2020-09-17 312/week @ 2020-09-24 251/week @ 2020-10-01 328/week @ 2020-10-08 491/week @ 2020-10-15 466/week @ 2020-10-22 328/week @ 2020-10-29 191/week @ 2020-11-05 181/week @ 2020-11-12 173/week @ 2020-11-19 292/week @ 2020-11-26

1,260 downloads per month
Used in 4 crates (2 directly)

MIT license

105KB
2.5K SLoC

rexif

RExif is a native Rust crate, written to extract EXIF data from JPEG and TIFF images.

The crate also contains a sample binary called 'rexiftool' that accepts files as arguments and prints the EXIF data. It gives a rough idea on how to use the crate.

I am still filling in the implementation of most EXIF tags. Merge requests, comments and criticisms about coding style, information about uncovered EXIF tags, sample images that are not parsed correctly -- in short, any sort of feedback is welcome!

Requirements

  • Latest stable Rust version (1.39 currently)

Example

match rexif::parse_file(&file_name) {
    Ok(exif) => {
        println!("{} {} exif entries: {}", file_name,
            exif.mime, exif.entries.len());

        for entry in &exif.entries {
            println!("    {}: {}",
                    entry.tag_readable,
                    entry.value_more_readable);
        }
    },
    Err(e) => {
        print!("Error in {}: {} {}", &file_name,
            Error::description(&e), e.extra).unwrap();
    }
}

The included tool refixtool accepts image file names as command-line parameters and prints EXIF data for them. The src/main.rs file is a good starting point to learn how to use the crate, then take a look into the ExifEntry struct.

Dependencies

~425KB