Skip to content

Commit

Permalink
bump jpegxl-rs version
Browse files Browse the repository at this point in the history
  • Loading branch information
Isotr0py committed Oct 15, 2023
1 parent 5c72e36 commit 1568f31
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pillow-jxl-plugin"
version = "1.0.0"
version = "1.0.1"
edition = "2021"
build = "build.rs"

Expand All @@ -11,7 +11,7 @@ crate-type = ["cdylib"]

[dependencies]
pyo3 = "0.19.2"
jpegxl-rs = { version = "0.8.2", default-features = false, features = ["threads"] }
jpegxl-rs = { version = "0.8.3", default-features = false, features = ["threads"] }

[features]
# Enables parallel processing support by enabling the "rayon" feature of jpeg-decoder.
Expand Down
11 changes: 11 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ impl Encoder {
let buffer: EncoderResult<u8> = encoder.encode(&data, width, height).unwrap();
PyBytes::new(_py, &buffer.data)
}

fn __repr__(&self) -> PyResult<String> {
Ok(format!(
"Encoder(parallel={}, has_alpha={}, lossless={}, quality={}, decoding_speed={})",
self.parallel, self.has_alpha, self.lossless, self.quality, self.decoding_speed
))
}
}

#[pyclass(module = "pillow_jxl")]
Expand Down Expand Up @@ -145,6 +152,10 @@ impl Decoder {
};
(ImageInfo::from(info), PyBytes::new(_py, &img))
}

fn __repr__(&self) -> PyResult<String> {
Ok(format!("Decoder(parallel={})", self.parallel))
}
}

#[pymodule]
Expand Down

0 comments on commit 1568f31

Please sign in to comment.