#exif #metadata #tiff #tag #gps

bin+lib rexif

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

9 releases

0.7.3 May 14, 2021
0.5.3 May 9, 2021
0.5.1 Oct 31, 2020
0.5.0 Jan 27, 2020
0.3.1 Nov 9, 2015

#710 in Images

Download history 1244/week @ 2023-06-02 1111/week @ 2023-06-09 1437/week @ 2023-06-16 1305/week @ 2023-06-23 1484/week @ 2023-06-30 1280/week @ 2023-07-07 840/week @ 2023-07-14 988/week @ 2023-07-21 747/week @ 2023-07-28 722/week @ 2023-08-04 720/week @ 2023-08-11 865/week @ 2023-08-18 604/week @ 2023-08-25 589/week @ 2023-09-01 1115/week @ 2023-09-08 675/week @ 2023-09-15

3,121 downloads per month
Used in 4 crates

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

~465KB