10 releases

0.3.1 Jun 17, 2018
0.3.0 Oct 22, 2017
0.2.3 Jul 16, 2017
0.2.1 Mar 27, 2017
0.1.0 Dec 31, 2016

#20 in Encoding

Download history 12/week @ 2018-05-04 12/week @ 2018-05-11 6/week @ 2018-05-18 28/week @ 2018-05-25 39/week @ 2018-06-01 6/week @ 2018-06-08 40/week @ 2018-06-15 34/week @ 2018-06-22 82/week @ 2018-06-29 4/week @ 2018-07-06 12/week @ 2018-07-13 43/week @ 2018-07-20 32/week @ 2018-07-27

74 downloads per month

Exif parsing library written in pure Rust

This is a pure-Rust library to parse Exif data. This library can parse TIFF and JPEG images and extract Exif attributes.

Usage

Add a dependency entry to your Cargo.toml. Specify "kamadak-exif" if you use crates.io. The canonical name of this crate is "exif", but it is renamed on crates.io to avoid a naming conflict.

  [dependencies]
  kamadak-exif = "0.3"

Add the following to your crate root.

  extern crate exif;

Run "cargo doc" in the source directory to generate the API reference. It is also available online at https://docs.rs/kamadak-exif.

See examples directory for sample codes.

Dependencies

Rust 1.20 or later is required to build.

Specifications

  • Exif Version 2.31
  • TIFF Revision 6.0

lib.rs:

This is a pure-Rust library to parse Exif data. This library can parse TIFF and JPEG images and extract Exif attributes.

Examples

An example to parse JPEG/TIFF files:

for path in &["tests/exif.jpg", "tests/exif.tif"] {
    let file = std::fs::File::open(path).unwrap();
    let reader = exif::Reader::new(
        &mut std::io::BufReader::new(&file)).unwrap();
    for f in reader.fields() {
        println!("{} {} {}",
                 f.tag, f.thumbnail, f.value.display_as(f.tag));
    }
}

Compatibility

Major changes between 0.2.3 and 0.3 are listed below.

  • Enum Error has two new variants: TooBig and NotSupported.
  • Value::Undefined has the 2nd member to keep the offset of the value.
  • Struct DateTime has two new fields: nanosecond and offset.
  • The tag constants have been changed to associated constants of struct Tag. Use Tag::TagName instead of tag::TagName.
BSD-2-Clause license
  • No runtime deps

Reverse deps