diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 746a860..1c60f2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ env: jobs: msrv: - name: Rust 1.85 MSRV + name: Rust 1.88 MSRV runs-on: ubuntu-24.04 steps: @@ -26,13 +26,13 @@ jobs: uses: actions/checkout@v4 - name: Install Rust - run: rustup toolchain install 1.85.0 --profile minimal --no-self-update + run: rustup toolchain install 1.88.0 --profile minimal --no-self-update - name: Cache Rust artifacts uses: Swatinem/rust-cache@v2 - name: Check all targets and features - run: cargo +1.85.0 check --workspace --all-targets --all-features --locked + run: cargo +1.88.0 check --workspace --all-targets --all-features --locked checks: runs-on: ubuntu-24.04 @@ -144,7 +144,7 @@ jobs: uses: actions/checkout@v4 - name: Install Rust stable for cargo-fuzz - run: rustup toolchain install 1.85.0 --profile minimal --no-self-update + run: rustup toolchain install 1.88.0 --profile minimal --no-self-update - name: Install Rust nightly run: rustup toolchain install nightly-2026-06-02 --profile minimal --component clippy --no-self-update @@ -153,12 +153,12 @@ jobs: uses: actions/cache@v4 with: path: ~/.cargo/bin/cargo-fuzz - key: cargo-fuzz-bin-v2-0.13.1-rust-1.85.0 + key: cargo-fuzz-bin-v2-0.13.1-rust-1.88.0 - name: Install cargo-fuzz run: | if ! command -v cargo-fuzz >/dev/null 2>&1; then - rustup run 1.85.0 cargo install cargo-fuzz --version 0.13.1 --locked + rustup run 1.88.0 cargo install cargo-fuzz --version 0.13.1 --locked fi - name: Cache Rust artifacts diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ee50fd..442f895 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased + +- upgrade `weezl` to 0.2.1 and raise the minimum supported Rust version to 1.88 + ## 0.8.1 - 2026-08-11 - support COG writing on `wasm32-unknown-unknown` by staging blocks and raw tiles in memory while retaining temporary-file spooling on native targets diff --git a/Cargo.lock b/Cargo.lock index 13fbe4b..3c76c0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1931,9 +1931,9 @@ dependencies = [ [[package]] name = "weezl" -version = "0.1.12" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" +checksum = "d4ca08e5ef825b65b056d9efbd95c8750683f0a6d0466d02e96dc2e4e360f3d2" [[package]] name = "winapi-util" diff --git a/Cargo.toml b/Cargo.toml index ec32586..03880aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ resolver = "2" [workspace.package] version = "0.8.1" edition = "2021" -rust-version = "1.85" +rust-version = "1.88" license = "MIT OR Apache-2.0" repository = "https://github.com/roteiro-gis/geotiff-rust" homepage = "https://github.com/roteiro-gis/geotiff-rust" diff --git a/docker/reference.Dockerfile b/docker/reference.Dockerfile index 053dcb3..37b6917 100644 --- a/docker/reference.Dockerfile +++ b/docker/reference.Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.85-bookworm +FROM rust:1.88-bookworm RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock index 9b16b59..7988dce 100644 --- a/fuzz/Cargo.lock +++ b/fuzz/Cargo.lock @@ -535,9 +535,9 @@ dependencies = [ [[package]] name = "weezl" -version = "0.1.12" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" +checksum = "d4ca08e5ef825b65b056d9efbd95c8750683f0a6d0466d02e96dc2e4e360f3d2" [[package]] name = "windows-link" diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 80ecad1..0e8e331 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -3,7 +3,7 @@ name = "geotiff-rust-fuzz" version = "0.0.0" publish = false edition = "2021" -rust-version = "1.85" +rust-version = "1.88" [package.metadata] cargo-fuzz = true diff --git a/geotiff-writer/src/cog.rs b/geotiff-writer/src/cog.rs index a86ba23..ef0145c 100644 --- a/geotiff-writer/src/cog.rs +++ b/geotiff-writer/src/cog.rs @@ -1216,7 +1216,9 @@ impl CogTileWriter { "write_tile only supports single-band COG output; use write_tile_3d for multi-band tiles".into(), )); } - if x_off % self.tile_width as usize != 0 || y_off % self.tile_height as usize != 0 { + if !x_off.is_multiple_of(self.tile_width as usize) + || !y_off.is_multiple_of(self.tile_height as usize) + { return Err(Error::Other(format!( "tile offsets must align to tile boundaries of {}x{}, got ({x_off},{y_off})", self.tile_width, self.tile_height @@ -1279,7 +1281,9 @@ impl CogTileWriter { y_off: usize, data: &ndarray::ArrayView3, ) -> Result<()> { - if x_off % self.tile_width as usize != 0 || y_off % self.tile_height as usize != 0 { + if !x_off.is_multiple_of(self.tile_width as usize) + || !y_off.is_multiple_of(self.tile_height as usize) + { return Err(Error::Other(format!( "tile offsets must align to tile boundaries of {}x{}, got ({x_off},{y_off})", self.tile_width, self.tile_height diff --git a/geotiff-writer/src/tile_writer.rs b/geotiff-writer/src/tile_writer.rs index 9a2e680..80dfec8 100644 --- a/geotiff-writer/src/tile_writer.rs +++ b/geotiff-writer/src/tile_writer.rs @@ -87,7 +87,9 @@ impl StreamingTileWriter { "write_tile only supports single-band output; use write_tile_3d for multi-band tiles".into(), )); } - if x_off % self.tile_width as usize != 0 || y_off % self.tile_height as usize != 0 { + if !x_off.is_multiple_of(self.tile_width as usize) + || !y_off.is_multiple_of(self.tile_height as usize) + { return Err(Error::Other(format!( "tile offsets must align to tile boundaries of {}x{}, got ({x_off},{y_off})", self.tile_width, self.tile_height @@ -151,7 +153,9 @@ impl StreamingTileWriter { y_off: usize, data: &ndarray::ArrayView3, ) -> Result<()> { - if x_off % self.tile_width as usize != 0 || y_off % self.tile_height as usize != 0 { + if !x_off.is_multiple_of(self.tile_width as usize) + || !y_off.is_multiple_of(self.tile_height as usize) + { return Err(Error::Other(format!( "tile offsets must align to tile boundaries of {}x{}, got ({x_off},{y_off})", self.tile_width, self.tile_height diff --git a/tiff-core/src/constants.rs b/tiff-core/src/constants.rs index 4deaa15..54da892 100644 --- a/tiff-core/src/constants.rs +++ b/tiff-core/src/constants.rs @@ -295,7 +295,7 @@ impl ColorMap { } pub fn from_tag_values(values: &[u16]) -> Result { - if values.len() % 3 != 0 { + if !values.len().is_multiple_of(3) { return Err(format!( "ColorMap tag length must be divisible by 3, got {} values", values.len() diff --git a/tiff-reader/Cargo.toml b/tiff-reader/Cargo.toml index fe6e6c8..2ba17ff 100644 --- a/tiff-reader/Cargo.toml +++ b/tiff-reader/Cargo.toml @@ -20,7 +20,7 @@ ndarray = { workspace = true } thiserror = { workspace = true } memmap2 = { workspace = true } flate2 = { version = "1.0.35", default-features = false, features = ["zlib-rs"] } -weezl = "0.1" +weezl = "0.2" lru = "0.16.3" parking_lot = "0.12" diff --git a/tiff-writer/Cargo.toml b/tiff-writer/Cargo.toml index 9d0c173..1f03680 100644 --- a/tiff-writer/Cargo.toml +++ b/tiff-writer/Cargo.toml @@ -18,7 +18,7 @@ lerc-core = { workspace = true } lerc-writer = { workspace = true } thiserror = { workspace = true } flate2 = { version = "1.0.35", default-features = false, features = ["zlib-rs"] } -weezl = "0.1" +weezl = "0.2" half = { workspace = true, optional = true } [features] diff --git a/tiff-writer/src/compress.rs b/tiff-writer/src/compress.rs index 22cb0d6..42c233e 100644 --- a/tiff-writer/src/compress.rs +++ b/tiff-writer/src/compress.rs @@ -165,7 +165,7 @@ fn compress_block_jpeg( if pixels_per_row == 0 { return Ok(Vec::new()); } - if samples.len() % pixels_per_row != 0 { + if !samples.len().is_multiple_of(pixels_per_row) { return Err(Error::CompressionFailed { index, reason: format!(