diff --git a/crates/image-codecs/src/codecs.rs b/crates/image-codecs/src/codecs.rs index cc1b5a44e..81288cb4d 100644 --- a/crates/image-codecs/src/codecs.rs +++ b/crates/image-codecs/src/codecs.rs @@ -18,10 +18,10 @@ pub(crate) mod jxl; pub(crate) mod pcx; pub(crate) mod png; pub(crate) mod pnm; -#[cfg(feature = "sunraster")] -pub(crate) mod sunraster; #[cfg(feature = "sgi")] pub(crate) mod sgi; +#[cfg(feature = "sunraster")] +pub(crate) mod sunraster; pub(crate) mod tga; pub(crate) mod tiff; pub(crate) mod tiff_exif; diff --git a/crates/image-codecs/src/format.rs b/crates/image-codecs/src/format.rs index aab2292b0..f4f3c7186 100644 --- a/crates/image-codecs/src/format.rs +++ b/crates/image-codecs/src/format.rs @@ -328,7 +328,13 @@ pub fn caps(format: Format) -> FormatCaps { Format::Cineon => FormatCaps { depths: &[S::U16], layouts: &[L::Gray, L::Rgb], alpha: false, ..base }, Format::Dicom => FormatCaps { read: true, write: false, depths: &[S::U8, S::U16], layouts: &[L::Gray, L::Rgb], alpha: false, ..base }, Format::Iff => FormatCaps { depths: &[S::U8], layouts: &[L::Rgb, L::Rgba], alpha: true, ..base }, - Format::SunRaster => FormatCaps { read: cfg!(feature = "sunraster"), write: cfg!(feature = "sunraster"), layouts: &[L::Gray, L::Rgb, L::Rgba], alpha: true, ..base }, + Format::SunRaster => FormatCaps { + read: cfg!(feature = "sunraster"), + write: cfg!(feature = "sunraster"), + layouts: &[L::Gray, L::Rgb, L::Rgba], + alpha: true, + ..base + }, Format::Sgi => { FormatCaps { read: cfg!(feature = "sgi"), write: cfg!(feature = "sgi"), depths: &[S::U8, S::U16], layouts: RGB_GRAY, alpha: true, ..base } } diff --git a/crates/image-codecs/src/lib.rs b/crates/image-codecs/src/lib.rs index c86301520..e958bada6 100644 --- a/crates/image-codecs/src/lib.rs +++ b/crates/image-codecs/src/lib.rs @@ -64,10 +64,10 @@ pub use crate::resolution::{exif_resolution, export_exif, export_xmp, photoshop_ pub use crate::source_settings::{WebpEncoding, jpeg_quality, webp_encoding}; pub use half::f16; -#[cfg(feature = "sunraster")] -use crate::codecs::sunraster; #[cfg(feature = "sgi")] use crate::codecs::sgi; +#[cfg(feature = "sunraster")] +use crate::codecs::sunraster; use crate::codecs::{dds, dicom, dpx, exr, fits, heif, iff, jp2, jpeg, jpegls, jxl, pcx, png, pnm, tiff, via_image, webp, xpm}; /// Detect the format and decode with default [`Limits`]. @@ -109,10 +109,14 @@ pub fn decode_as_with(format: Format, bytes: &[u8], opts: &DecodeOptions) -> Res Format::Iff => iff::decode(bytes, l), Format::SunRaster => { #[cfg(feature = "sunraster")] - { sunraster::decode(bytes, l) } + { + sunraster::decode(bytes, l) + } #[cfg(not(feature = "sunraster"))] - { Err(CodecError::unsupported(format, "Sun Raster support requires the sunraster feature")) } - }, + { + Err(CodecError::unsupported(format, "Sun Raster support requires the sunraster feature")) + } + } Format::Sgi => { #[cfg(feature = "sgi")] { @@ -482,10 +486,14 @@ pub fn encode(image: &Image, format: Format, opts: &EncodeOptions) -> Result iff::encode(image, plan), Format::SunRaster => { #[cfg(feature = "sunraster")] - { sunraster::encode(image, plan) } + { + sunraster::encode(image, plan) + } #[cfg(not(feature = "sunraster"))] - { Err(CodecError::unsupported(format, "Sun Raster support requires the sunraster feature")) } - }, + { + Err(CodecError::unsupported(format, "Sun Raster support requires the sunraster feature")) + } + } Format::Sgi => { #[cfg(feature = "sgi")] {