Add an example to parse a JPEG file.

This commit is contained in:
KAMADA Ken'ichi 2016-12-18 23:38:11 +09:00
parent 5d9190304f
commit 92a3c49bb2
2 changed files with 14 additions and 0 deletions

View File

@ -25,6 +25,20 @@
//
//! Exif parsing library written in pure Rust.
//!
//! # Examples
//!
//! An example to parse a JPEG file:
//!
//! ```
//! let file = std::fs::File::open("tests/exif.jpg").unwrap();
//! let mut reader = std::io::BufReader::new(&file);
//! let buf = exif::get_exif_attr_from_jpeg(&mut reader).unwrap();
//! let (fields, _) = exif::parse_exif(&buf).unwrap();
//! for f in fields {
//! println!("{} {} {:?}", f.tag, f.thumbnail, f.value);
//! }
//! ```
pub use error::Error;
pub use jpeg::get_exif_attr as get_exif_attr_from_jpeg;

BIN
tests/exif.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB