Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Orientation to metadata module #2349

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, metadata::Orientation};
Shnatsel marked this conversation as resolved.
Show resolved Hide resolved
///
/// 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
Loading