pub struct Reader {}
Expand description

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

Constructs a new Reader.

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

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
  • WebP

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

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.