exif

Crates.ioexif
lib.rsexif
version0.0.1
sourcesrc
created_at2016-09-06 01:15:08.596397
updated_at2016-09-06 01:15:08.596397
descriptionRust wrapper for libexif
homepagehttps://gitlab.com/dcuddeback/exif
repositoryhttps://gitlab.com/dcuddeback/exif
max_upload_size
id6259
size28,249
David Cuddeback (dcuddeback)

documentation

README

EXIF

The exif crate provides a safe wrapper around the native libexif library.

Dependencies

In order to use the exif crate, you must have the libexif library installed where it can be found by pkg-config.

Usage

Add exif as a dependency in Cargo.toml:

[dependencies]
exif = "0.0.1"

Import the exif crate.

extern crate exif;

use std::io;
use std::path::Path;

fn dump_exif<P: AsRef<Path>>(file_name: P) -> io::Result<()> {
    let data = try!(exif::Data::open("image.jpg"));

    for content in data.contents() {
        println!("[{:=>32}{:=>46}]", format!(" {:?} ", content.ifd()), "");

        for entry in content.entries() {
            println!("  {:<30} = {}",
                    entry.tag().title(content.ifd()),
                    entry.text_value());
        }
    }

    Ok(())
}

License

Copyright © 2016 David Cuddeback

Distributed under the MIT License.

Note: By using this crate, your executable will link to the libexif C library, which is licensed under the LGPL version 2.1.

Commit count: 2

cargo fmt