Skip to content

Commit

Permalink
Merge pull request #2349 from Shnatsel/orientation-in-metadata
Browse files Browse the repository at this point in the history
Move Orientation to metadata module
  • Loading branch information
Shnatsel authored Oct 15, 2024
2 parents dd87098 + 91a001f commit 5976c19
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/codecs/jpeg/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use crate::error::{
DecodingError, ImageError, ImageResult, LimitError, UnsupportedError, UnsupportedErrorKind,
};
use crate::image::{ImageDecoder, ImageFormat};
use crate::{Limits, Orientation};
use crate::metadata::Orientation;
use crate::Limits;

type ZuneColorSpace = zune_core::colorspace::ColorSpace;

Expand Down
2 changes: 1 addition & 1 deletion src/codecs/tiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::error::{
ParameterError, ParameterErrorKind, UnsupportedError, UnsupportedErrorKind,
};
use crate::image::{ImageDecoder, ImageEncoder, ImageFormat};
use crate::Orientation;
use crate::metadata::Orientation;

/// Decoder for TIFF images.
pub struct TiffDecoder<R>
Expand Down
5 changes: 2 additions & 3 deletions src/codecs/webp/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ use std::io::{BufRead, Read, Seek};
use crate::buffer::ConvertBuffer;
use crate::error::{DecodingError, ImageError, ImageResult};
use crate::image::{ImageDecoder, ImageFormat};
use crate::{
AnimationDecoder, ColorType, Delay, Frame, Frames, Orientation, RgbImage, Rgba, RgbaImage,
};
use crate::metadata::Orientation;
use crate::{AnimationDecoder, ColorType, Delay, Frame, Frames, RgbImage, Rgba, RgbaImage};

/// WebP Image format decoder.
///
Expand Down
5 changes: 3 additions & 2 deletions src/dynimage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ use crate::flat::FlatSamples;
use crate::image::{GenericImage, GenericImageView, ImageDecoder, ImageEncoder, ImageFormat};
use crate::image_reader::free_functions;
use crate::math::resize_dimensions;
use crate::metadata::Orientation;
use crate::traits::Pixel;
use crate::ImageReader;
use crate::{image, Luma, LumaA};
use crate::{imageops, ExtendedColorType};
use crate::{ImageReader, Orientation};
use crate::{Rgb32FImage, Rgba32FImage};

/// A Dynamic Image
Expand Down Expand Up @@ -940,7 +941,7 @@ impl DynamicImage {
///
/// ```
/// # fn only_check_if_this_compiles() -> Result<(), Box<dyn std::error::Error>> {
/// use image::{Orientation, DynamicImage, ImageReader, ImageDecoder};
/// use image::{DynamicImage, ImageReader, ImageDecoder};
///
/// let mut decoder = ImageReader::open("file.jpg")?.into_decoder()?;
/// let orientation = decoder.orientation()?;
Expand Down
3 changes: 2 additions & 1 deletion src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ use crate::error::{
ParameterErrorKind, UnsupportedError, UnsupportedErrorKind,
};
use crate::math::Rect;
use crate::metadata::Orientation;
use crate::traits::Pixel;
use crate::{ImageBuffer, Orientation};
use crate::ImageBuffer;

use crate::animation::Frames;

Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ pub use crate::image_reader::{ImageReader, LimitSupport, Limits};
pub use crate::dynimage::DynamicImage;

pub use crate::animation::{Delay, Frame, Frames};
pub use crate::metadata::Orientation;

// More detailed error type
pub mod error;
Expand Down Expand Up @@ -290,7 +289,7 @@ mod color;
mod dynimage;
mod image;
mod image_reader;
mod metadata;
pub mod metadata;
//TODO delete this module after a few releases
/// deprecated io module the original io module has been renamed to `image_reader`
pub mod io {
Expand Down
2 changes: 2 additions & 0 deletions src/metadata.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Types describing image metadata

use std::io::{Cursor, Read};

use byteorder_lite::{BigEndian, LittleEndian, ReadBytesExt};
Expand Down

0 comments on commit 5976c19

Please sign in to comment.