mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-25 15:44:29 +00:00
fix: update JXL capability test and format craft-exr (#2298)
This commit is contained in:
@@ -1076,11 +1076,7 @@ pub fn write_to<W: std::io::Write + std::io::Seek>(
|
||||
};
|
||||
list.push(AnyChannel::new(name, samples));
|
||||
}
|
||||
let encoding = Encoding {
|
||||
compression: to_exr_compression(compression),
|
||||
blocks: Blocks::ScanLines,
|
||||
line_order: LineOrder::Increasing,
|
||||
};
|
||||
let encoding = Encoding { compression: to_exr_compression(compression), blocks: Blocks::ScanLines, line_order: LineOrder::Increasing };
|
||||
let layer = Layer::new((width as usize, height as usize), LayerAttributes::default(), encoding, AnyChannels::sort(list.into_iter().collect()));
|
||||
let mut image = exr::image::Image::from_layer(layer);
|
||||
image.attributes.chromaticities = to_exr_chromaticities(chromaticities);
|
||||
@@ -1114,11 +1110,7 @@ pub fn write_rgba<W: std::io::Write + std::io::Seek>(
|
||||
_ => [0.0; 4],
|
||||
}
|
||||
};
|
||||
let encoding = Encoding {
|
||||
compression: to_exr_compression(compression),
|
||||
blocks: Blocks::ScanLines,
|
||||
line_order: LineOrder::Increasing,
|
||||
};
|
||||
let encoding = Encoding { compression: to_exr_compression(compression), blocks: Blocks::ScanLines, line_order: LineOrder::Increasing };
|
||||
let chroma = to_exr_chromaticities(chromaticities);
|
||||
match depth {
|
||||
SampleDepth::Float => {
|
||||
|
||||
@@ -26,6 +26,9 @@ fn known_formats_separate_build_disabled_and_unsupported_operations() {
|
||||
#[cfg(not(feature = "raster-codecs"))]
|
||||
assert_eq!(jpeg.read, Availability::BuildDisabled);
|
||||
|
||||
#[cfg(all(feature = "raster-codecs", feature = "jxl"))]
|
||||
assert_eq!(Format::Jxl.capabilities().read, Availability::Available);
|
||||
#[cfg(not(all(feature = "raster-codecs", feature = "jxl")))]
|
||||
assert_eq!(Format::Jxl.capabilities().read, Availability::Unsupported);
|
||||
#[cfg(not(feature = "raster-codecs"))]
|
||||
assert_eq!(Format::Jxl.capabilities().write, Availability::BuildDisabled);
|
||||
|
||||
Reference in New Issue
Block a user