diff --git a/Cargo.lock b/Cargo.lock index 28494363..311753dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2295,9 +2295,9 @@ dependencies = [ [[package]] name = "jxl-frame" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2c4e276ea56d8bc4961f13501d565cc6b665f0da76e0e5f90aa44a1475eb409" +checksum = "8d63bdd104e3746669a123de86f940aa5d59fdc9c5a65f16a4f867dde75e45e1" dependencies = [ "jxl-bitstream", "jxl-coding", @@ -2316,9 +2316,9 @@ checksum = "48800b21ed6bb3bbc2f818ae9cd40530bdfb1a211f57d5a7a49b8b10f62145e8" [[package]] name = "jxl-image" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d10c717baa0dd19c25b37b6baebb5f07d7efdaa6225a65aa98dcaf1d40a3e5" +checksum = "ef86f7f74acc9c9e66604c8d030e00cdef5a0c455ea3d7d26bd9ddbb9160be59" dependencies = [ "jxl-bitstream", "jxl-color", @@ -2328,9 +2328,9 @@ dependencies = [ [[package]] name = "jxl-modular" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4fea731da48d358a60d6185c58ac897f22895ea0e3380df04c106c87e192a7d" +checksum = "504e6b55db362568592be81993c772fc6786c56fb67ae769ff62dc514c3e6748" dependencies = [ "jxl-bitstream", "jxl-coding", @@ -2340,9 +2340,9 @@ dependencies = [ [[package]] name = "jxl-oxide" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d90d7ccb9a843e69563abdab2cd362702668f23e39e7fa3dcdf2594b1d29042" +checksum = "57e3b7e459d823979c4ca0c9584f391581db154437f34596ea443b082e9b6064" dependencies = [ "jxl-bitstream", "jxl-color", @@ -2355,9 +2355,9 @@ dependencies = [ [[package]] name = "jxl-render" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774684715db3b6e60a13059ad746829c9f9b39b7865ba0dc7ea9fd93469d9297" +checksum = "7157d1c6c4896ddc800cb0cc8ba545ba7417ab9afc51f39e69484e6607c8707e" dependencies = [ "jxl-bitstream", "jxl-coding", @@ -2372,9 +2372,9 @@ dependencies = [ [[package]] name = "jxl-vardct" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1abaffccbc217e48cb45b9aca639c18a873b66200fc5a3695fb98333e0b1fead" +checksum = "eb4a2d9ba8c48a52f6143ba01c38aac67d1309c9b939a9f84cd60f650d15053e" dependencies = [ "jxl-bitstream", "jxl-coding", diff --git a/Cargo.toml b/Cargo.toml index a46c0a08..819be830 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,7 +58,7 @@ turbojpeg = {version = "0.5", features = ["image"], optional = true} usvg = "0.33.0" webbrowser = "0.8" tiff = "0.9" -jxl-oxide = "0.3.0" +jxl-oxide = "0.4" zune-png = "0.2" img-parts = "0.3.0" dark-light = "1.0.0" diff --git a/src/image_loader.rs b/src/image_loader.rs index 7d12957a..1f056181 100644 --- a/src/image_loader.rs +++ b/src/image_loader.rs @@ -234,11 +234,10 @@ pub fn open_image(img_location: &Path) -> Result> { fn foo(img_location: &Path, frame_sender: Sender) -> Result<()> { let mut image = JxlImage::open(img_location).map_err(|e| anyhow!("{e}"))?; - let mut renderer = image.renderer(); - debug!("{:#?}", renderer.image_header().metadata); - let is_jxl_anim = renderer.image_header().metadata.animation.is_some(); - let ticks_ms = renderer + debug!("{:#?}", image.image_header().metadata); + let is_jxl_anim = image.image_header().metadata.animation.is_some(); + let ticks_ms = image .image_header() .metadata .animation @@ -252,7 +251,7 @@ pub fn open_image(img_location: &Path) -> Result> { loop { // create a mutable image to hold potential decoding results. We can then use this only once at the end of the loop/ let image_result: DynamicImage; - let result = renderer + let result = image .render_next_frame() .map_err(|e| anyhow!("{e}")) .context("Can't render JXL")?; @@ -261,8 +260,8 @@ pub fn open_image(img_location: &Path) -> Result> { let frame_duration = render.duration() as u16 * ticks_ms; debug!("duration {frame_duration} ms"); let framebuffer = render.image(); - debug!("{:?}", renderer.pixel_format()); - match renderer.pixel_format() { + debug!("{:?}", image.pixel_format()); + match image.pixel_format() { PixelFormat::Graya => { let float_image = GrayAlphaImage::from_raw( framebuffer.width() as u32, @@ -320,7 +319,7 @@ pub fn open_image(img_location: &Path) -> Result> { image_result = DynamicImage::ImageRgb8(float_image); } _ => { - bail!("JXL: Pixel format: {:?}", renderer.pixel_format()) + bail!("JXL: Pixel format: {:?}", image.pixel_format()) } }