[−][src]Struct exif::Reader
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]
R: BufRead,
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]
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>,