[][src]Struct exif::Reader

pub struct Reader {}

A struct to parse the Exif attributes and create an Exif instance that holds the results.

Examples

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

Implementations

impl Reader[src]

pub fn new() -> Self[src]

Construct a new Reader.

pub fn read_raw(&self, data: Vec<u8>) -> Result<Exif, Error>[src]

Parses the Exif attributes from raw Exif data. If an error occurred, exif::Error is returned.

pub fn read_from_container<R>(&self, reader: &mut R) -> Result<Exif, Error> where
    R: BufRead + Seek
[src]

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

Supported formats are:

  • TIFF and some RAW image formats based on it
  • JPEG
  • HEIF and coding-specific variations including HEIC and AVIF
  • PNG

This method is provided for the convenience even though parsing containers is basically out of the scope of this library.

Auto Trait Implementations

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.