[][src]Struct exif::Reader

pub struct Reader { /* fields omitted */ }

The Reader struct reads a JPEG or TIFF image, parses the Exif attributes in it, and holds the results.

Examples

use exif::{In, Reader, Tag};
let file = std::fs::File::open("tests/exif.jpg").unwrap();
let reader = Reader::new(&mut std::io::BufReader::new(&file)).unwrap();
let xres = reader.get_field(Tag::XResolution, In::PRIMARY).unwrap();
assert_eq!(xres.display_value().with_unit(&reader).to_string(),
           "72 pixels per inch");

Methods

impl Reader[src]

pub fn new<R>(reader: &mut R) -> Result<Reader, Error> where
    R: BufRead
[src]

Reads a JPEG or TIFF image and parses the Exif attributes in it. If an error occurred, exif::Error is returned.

pub fn buf(&self) -> &[u8][src]

Returns the slice that contains the TIFF data.

pub fn fields(&self) -> impl ExactSizeIterator<Item = &Field>[src]

Returns a slice of Exif fields.

pub fn little_endian(&self) -> bool[src]

Returns true if the TIFF data is in the little-endian byte order.

pub fn get_field(&self, tag: Tag, ifd_num: In) -> Option<&Field>[src]

Returns a reference to the Exif field specified by the tag and the IFD number.

Auto Trait Implementations

impl !RefUnwindSafe for Reader

impl Send for Reader

impl !Sync for Reader

impl Unpin for Reader

impl UnwindSafe for Reader

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.