feat: set defaults for jxl encoding explicitly

at least while there's no way to select options;
this at least works for some usecases
This commit is contained in:
electria 2026-07-03 14:46:28 -07:00
commit 8627ec026f
Signed by: electria
SSH key fingerprint: SHA256:8LlB3ucPbBHqozqkhsNbaV5oG3SlzzqUj8FZDL6IPQs

View file

@ -234,7 +234,11 @@ impl State {
match path.extension().map(OsStr::to_string_lossy).as_deref() { match path.extension().map(OsStr::to_string_lossy).as_deref() {
Some("jxl") => { Some("jxl") => {
let mut encoder = jpegxl_rs::encoder_builder().build().unwrap(); let mut encoder = jpegxl_rs::encoder_builder()
.speed(jpegxl_rs::encode::EncoderSpeed::Glacier)
.lossless(true)
.build()
.unwrap();
let rgb_image = DynamicImage::from(image.to_owned()).into_rgb8(); let rgb_image = DynamicImage::from(image.to_owned()).into_rgb8();
let jxl = match encoder.encode::<u8, u8>( let jxl = match encoder.encode::<u8, u8>(
&rgb_image, &rgb_image,