diff --git a/Cargo.toml b/Cargo.toml index aacf80aee8..c540d148f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,6 @@ num-complex = "0.4" glob = "0.3" quickcheck = "1" criterion = "0.5.0" -kamadak-exif = "0.5.5" [features] default = ["rayon", "default-formats"] diff --git a/src/dynimage.rs b/src/dynimage.rs index 027b932743..273ac03a38 100644 --- a/src/dynimage.rs +++ b/src/dynimage.rs @@ -940,25 +940,12 @@ impl DynamicImage { /// /// ``` /// # fn only_check_if_this_compiles() -> Result<(), Box> { - /// # use image::{Orientation, DynamicImage, ImageReader, ImageDecoder}; - /// use exif::{In, Tag}; // third-party crate `kamadak_exif` is needed to parse Exif chunk + /// use image::{Orientation, DynamicImage, ImageReader, ImageDecoder}; /// /// let mut decoder = ImageReader::open("file.jpg")?.into_decoder()?; - /// let raw_exif = decoder.exif_metadata(); + /// let orientation = decoder.orientation()?; /// let mut image = DynamicImage::from_decoder(decoder)?; - /// - /// // Parse Exif chunk (if present) and apply the orientation - /// if let Ok(Some(raw_exif)) = raw_exif { - /// let reader = exif::Reader::new(); - /// let exif = reader.read_raw(raw_exif)?; - /// if let Some(orientation) = exif.get_field(Tag::Orientation, In::PRIMARY) { - /// if let Some(value) = orientation.value.get_uint(0) { - /// if let Some(orientation) = Orientation::from_exif(value as u8) { - /// image.apply_orientation(orientation); - /// } - /// } - /// } - /// } + /// image.apply_orientation(orientation); /// # Ok(()) /// # } /// ``` diff --git a/src/metadata.rs b/src/metadata.rs index ea33af07eb..01da89bc6c 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -5,7 +5,7 @@ use byteorder_lite::{BigEndian, LittleEndian, ReadBytesExt}; /// Describes the transformations to be applied to the image. /// Compatible with [Exif orientation](https://web.archive.org/web/20200412005226/https://www.impulseadventure.com/photo/exif-orientation.html). /// -/// Orientation is specified in the Exif metadata, and is often written by cameras. +/// Orientation is specified in the file's metadata, and is often written by cameras. /// /// You can apply it to an image via [`DynamicImage::apply_orientation`](crate::DynamicImage::apply_orientation). #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]