Skip to content

Commit

Permalink
⬆️ Upgrade libjxl to v0.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
inflation committed Feb 11, 2024
1 parent d564940 commit 9855b5a
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "libjxl"]
path = jpegxl-src/libjxl
url = https://github.com/libjxl/libjxl
branch = tags/v0.9.1
branch = tags/v0.9.2
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[workspace]
members = ["jpegxl-src", "jpegxl-sys", "jpegxl-rs"]
resolver = "2"
resolver = "2"

[workspace.dependencies]
pretty_assertions = "1.4.0"
13 changes: 7 additions & 6 deletions jpegxl-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "GPL-3.0-or-later"
name = "jpegxl-rs"
readme = "README.md"
repository = "https://github.com/inflation/jpegxl-rs"
version = "0.9.0+libjxl-0.9.1"
version = "0.9.1+libjxl-0.9.2"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -28,21 +28,22 @@ bench = []

[dependencies]
derive_builder = "0.13.0"
image = { version = "0.24.7", optional = true, default-features = false }
thiserror = "1.0.51"
image = { version = "0.24.8", optional = true, default-features = false }
thiserror = "1.0.56"
half = "2.3.1"
byteorder = "1.5.0"

[dependencies.jpegxl-sys]
version = "0.9.0"
version = "0.9.1"
path = "../jpegxl-sys"

[dev-dependencies]
image = { version = "0.24.7", default-features = false, features = [
image = { version = "0.24.8", default-features = false, features = [
"jpeg",
"png",
] }
lcms2 = "6.0.3"
lcms2 = "6.0.4"
pretty_assertions.workspace = true
testresult = "0.3.0"

[target.'cfg(not(target_family = "wasm"))'.dev-dependencies]
Expand Down
8 changes: 4 additions & 4 deletions jpegxl-rs/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,17 @@ fn to_image(

#[cfg(test)]
mod tests {
use half::f16;
use testresult::TestResult;

use super::*;
use crate::{
decode::PixelFormat,
decoder_builder,
tests::{SAMPLE_JXL, SAMPLE_JXL_GRAY, SAMPLE_PNG},
ThreadsRunner,
};

use super::*;
use half::f16;
use pretty_assertions::assert_eq;
use testresult::TestResult;

#[test]
#[cfg_attr(coverage_nightly, coverage(off))]
Expand Down
2 changes: 1 addition & 1 deletion jpegxl-rs/src/tests/decode.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use half::f16;
use image::ImageDecoder;

use pretty_assertions::assert_eq;
use testresult::TestResult;

use crate::{
Expand Down
1 change: 1 addition & 0 deletions jpegxl-rs/src/tests/encode.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use half::f16;
use image::DynamicImage;
use pretty_assertions::assert_eq;
use testresult::TestResult;

use crate::{
Expand Down
3 changes: 2 additions & 1 deletion jpegxl-rs/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ pub fn check_valid_signature(buf: &[u8]) -> Option<bool> {
#[cfg(test)]
mod tests {
use super::*;

use crate::tests::SAMPLE_JXL;

use pretty_assertions::assert_eq;

#[test]
fn test_signature() {
assert!(check_valid_signature(&[]).is_none());
Expand Down
2 changes: 1 addition & 1 deletion jpegxl-src/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "BSD-3-Clause"
name = "jpegxl-src"
readme = "README.md"
repository = "https://github.com/inflation/jpegxl-rs"
version = "0.9.1"
version = "0.9.2"
exclude = [
"libjxl/third_party/libpng",
"libjxl/third_party/sjpeg",
Expand Down
9 changes: 5 additions & 4 deletions jpegxl-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ links = "jxl"
name = "jpegxl-sys"
readme = "README.md"
repository = "https://github.com/inflation/jpegxl-rs"
version = "0.9.0+libjxl-0.9.1"
version = "0.9.1+libjxl-0.9.2"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -21,15 +21,16 @@ module_name_repetitions = "allow"
features = ["docs"]

[build-dependencies]
pkg-config = "0.3.28"
pkg-config = "0.3.29"

[build-dependencies.jpegxl-src]
version = "0.9.0"
version = "0.9.2"
path = "../jpegxl-src"
optional = true

[dev-dependencies]
image = { version = "0.24.7", default-features = false, features = ["png"] }
image = { version = "0.24.8", default-features = false, features = ["png"] }
pretty_assertions.workspace = true

[features]
default = ["threads"]
Expand Down
7 changes: 5 additions & 2 deletions jpegxl-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ mod test {
},
types::*,
};

use std::{mem::MaybeUninit, ptr};

use pretty_assertions::assert_eq;

const SAMPLE_PNG: &[u8] = include_bytes!("../../samples/sample.png");
const SAMPLE_JXL: &[u8] = include_bytes!("../../samples/sample.jxl");

Expand Down Expand Up @@ -81,8 +84,8 @@ mod test {
#[cfg_attr(coverage_nightly, coverage(off))]
fn test_bindings_version() {
unsafe {
assert_eq!(JxlDecoderVersion(), 9001);
assert_eq!(JxlEncoderVersion(), 9001);
assert_eq!(JxlDecoderVersion(), 9002);
assert_eq!(JxlEncoderVersion(), 9002);
}
}

Expand Down

0 comments on commit 9855b5a

Please sign in to comment.