[−][src]Struct exif::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]
R: BufRead + Seek,
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,