Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.25.0 #2164

Merged
merged 26 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
85721e3
Run CI for next branch (#2134)
fintelia Feb 11, 2024
79ecd0f
Improve ImageDecoder trait (#1869)
fintelia Feb 12, 2024
5abf7b5
Make color_quant optional (#2030)
fintelia Feb 12, 2024
d3f6794
Simplify cargo features (#1976)
fintelia Feb 12, 2024
98672f6
Remove deprecated items (#2135)
fintelia Feb 12, 2024
9a8332f
Remove ImageOutputFormat (#2138)
fintelia Feb 12, 2024
f9ee4bd
Make Limits `#[non_exhaustive]` (#2137)
fintelia Feb 12, 2024
0aa073e
Don't globally allow any clippy lints (#2139)
fintelia Feb 12, 2024
a3da32b
Switch to using zune-jpeg for JPEG decoding (#2141)
fintelia Feb 12, 2024
5607588
Update zune-jpeg to 0.4.x (#2143)
Shnatsel Feb 12, 2024
2643c75
Add note on the meaning of 'ff' feature (#2140)
fintelia Feb 13, 2024
3b1fbcf
Switch to image-webp (#2148)
fintelia Feb 18, 2024
a0ebeab
Use ExtendedColorType when encoding (#2142)
fintelia Feb 19, 2024
0ed15a8
Add BufRead + Seek bound on many decoders (#2149)
fintelia Feb 19, 2024
ac9b875
Have HDR decoder produce f32 images (#2150)
fintelia Feb 19, 2024
fe7f010
Merge branch 'master' into next
fintelia Feb 24, 2024
bfc509e
Update readme (#2155)
fintelia Feb 24, 2024
478ad43
Make pixel types repr(transparent) rather than repr(C) (#2156)
fintelia Feb 24, 2024
ddb9c36
Cache cargo-fuzz install (#2157)
fintelia Feb 24, 2024
a207477
Speed up CI runs (#2158)
fintelia Feb 25, 2024
1f2238f
Cache registry cache in cargo-afl CI job (#2159)
fintelia Feb 25, 2024
d6f4761
Force install to fix cache issue (#2160)
fintelia Feb 25, 2024
515b7e8
Release 0.25.0-preview.0 (#2161)
fintelia Feb 25, 2024
affd32a
Fix clippy warnings (#2163)
fintelia Mar 9, 2024
29a3d10
Release 0.25.0
fintelia Mar 9, 2024
c5a1be7
Documentation fix
fintelia Mar 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
84 changes: 30 additions & 54 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Rust CI

on:
push:
branches: [ master, main, next ]
branches: [ master, main, next-version-0.25 ]
pull_request:
branches: [ master, main, next ]
branches: [ master, main, next-version-0.25 ]
schedule:
- cron: '5 16 * * 6'

Expand All @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
features: ['', default, gif, jpeg, png, tiff, ico, pnm, tga, webp, bmp, hdr, dxt, dds, farbfeld, openexr, jpeg_rayon, webp-encoder]
features: ['', default, rayon, avif, bmp, dds, exr, ff, gif, hdr, ico, jpeg, png, pnm, qoi, tga, tiff, webp]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -38,14 +38,14 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: ["1.63.0", nightly, beta]
rust: ["1.67.1", nightly, beta]
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@nightly
if: ${{ matrix.rust == '1.63.0' }}
if: ${{ matrix.rust == '1.67.1' }}
- name: Generate Cargo.lock with minimal-version dependencies
if: ${{ matrix.rust == '1.63.0' }}
if: ${{ matrix.rust == '1.67.1' }}
run: cargo -Zminimal-versions generate-lockfile

- uses: dtolnay/rust-toolchain@v1
Expand All @@ -56,12 +56,10 @@ jobs:
with:
cache-on-failure: true
- name: build
run: cargo build -v --features webp,webp-encoder
run: cargo build -v
- name: test
if: ${{ matrix.rust != '1.63.0' }}
run: >
cargo test -v --features webp,webp-encoder &&
cargo doc -v --features webp,webp-encoder
if: ${{ matrix.rust != '1.67.1' }}
run: cargo test -v && cargo doc -v

test_other_archs:
# github actions does not support 32-bit or big endian systems directly, but
Expand All @@ -73,7 +71,6 @@ jobs:
fail-fast: false
matrix:
arch: [powerpc-unknown-linux-gnu, i686-unknown-linux-gnu]
features: [default, webp-encoder]
steps:
- uses: actions/checkout@v4
- name: Install or use cached cross-rs/cross
Expand All @@ -84,23 +81,11 @@ jobs:
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
key: ${{ matrix.arch }}
- name: Start Docker (required for cross-rs)
run: sudo systemctl start docker
- name: Cross-Run Tests using QEMU
run: |
cross test --target ${{ matrix.arch }} --verbose -v --no-default-features --features "$FEATURES"
env:
FEATURES: ${{ matrix.features }}

test_avif:
runs-on: ubuntu-latest
steps:
- name: install-dependencies
run: sudo apt update && sudo apt install nasm
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: build
run: cargo build -v --no-default-features --features="avif"
run: cross test --target ${{ matrix.arch }}

test_avif_decoding:
runs-on: ubuntu-latest
Expand All @@ -110,7 +95,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: build
run: cargo build -v --no-default-features --features="avif,avif-decoder"
run: cargo build -v --no-default-features --features="avif,avif-native"
env:
SYSTEM_DEPS_DAV1D_BUILD_INTERNAL: always

Expand All @@ -135,9 +120,16 @@ jobs:
- uses: dtolnay/rust-toolchain@nightly
- name: install-deps
run: sudo apt-get -y install clang llvm
- name: Cache Cargo Registry
uses: Swatinem/rust-cache@v2
with:
cache-targets: false
cache-all-crates: true
cache-on-failure: true
- name: Install cargo-afl
run: cargo install --locked -f cargo-afl
- name: build
run: |
cargo install cargo-afl
cd fuzz-afl
cargo check --bin reproduce_webp
cargo check --bin reproduce_pnm
Expand All @@ -152,15 +144,14 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: build
run: |
cargo install cargo-fuzz
cargo fuzz build
- name: fuzz
run: |
for format in $(cargo fuzz list); do
cargo fuzz run "$format" -- -runs=0;
done
- name: Install cargo-fuzz
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-fuzz
- name: check
run: cargo fuzz check
env:
CARGO_INCREMENTAL: 0

public_private_dependencies:
runs-on: ubuntu-latest
Expand All @@ -169,9 +160,10 @@ jobs:
- uses: dtolnay/rust-toolchain@nightly
- name: build
run: |
mv ./Cargo.toml.public-private-dependencies ./Cargo.toml
echo "#![deny(exported_private_dependencies)]" | cat - src/lib.rs > src/lib.rs.0
mv src/lib.rs.0 src/lib.rs
echo 'cargo-features = ["public-dependency"]' | cat - Cargo.toml > Cargo.toml.0
mv Cargo.toml.0 Cargo.toml
cargo check

build_benchmarks:
Expand All @@ -197,19 +189,3 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1

verify_msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install or use cached `cargo-msrv`
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-msrv

- uses: dtolnay/rust-toolchain@nightly
- name: Generate Cargo.lock with minimal-version dependencies
run: cargo -Zminimal-versions generate-lockfile

- name: Verify Minimum Rust Version against `-Zminimal-versions` dependencies
run: cargo-msrv verify
21 changes: 21 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@

## Changes

### Version 0.25.0

Breaking changes:
- Added `BufRead` + `Seek` bound on many decoders.
- Use `ExtendedColorType` instead of `ColorType` when encoding.
- Removed `ImageOutputFormat`, `GenericImageView::bounds`, and several other
deprecated items.
- Removed incremental decoding support and changed `ImageDecoder` so the trait
is object safe.
- Pixel types are now `repr(transparent)` rather than `repr(C)`.
- Made color_quant dependency optional.
- Renamed some feature flags.

Structural changes:
- Increased MSRV to 1.67.1

Codec changes:
- Switched to image-webp for WebP encoding.
- Switched to zune-jpeg for JPEG decoding.
- Made the HDR decoder produce f32 images.

### Version 0.24.9

Structural changes:
Expand Down
80 changes: 37 additions & 43 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "image"
version = "0.24.9"
version = "0.25.0"
edition = "2021"
resolver = "2"

# note: when changed, also update test runner in `.github/workflows/rust.yml`
rust-version = "1.63.0"
rust-version = "1.67.1"

license = "MIT OR Apache-2.0"
description = "Imaging library. Provides basic image processing and encoders/decoders for common image formats."
Expand All @@ -31,69 +31,63 @@ include = [
"/benches/",
]

# Crate build related
exclude = ["src/png/testdata/*", "examples/*", "tests/*"]

[dependencies]
bytemuck = { version = "1.8.0", features = ["extern_crate_alloc"] } # includes cast_vec
byteorder = "1.3.2"
num-traits = "0.2.0"
gif = { version = "0.13", optional = true }
jpeg = { package = "jpeg-decoder", version = "0.3.0", default-features = false, optional = true }
png = { version = "0.17.6", optional = true }
tiff = { version = "0.9.0", optional = true }
ravif = { version = "0.11.0", optional = true }
rgb = { version = "0.8.25", optional = true }
mp4parse = { version = "0.17.0", optional = true }
num-traits = { version = "0.2.0" }

# Optional dependencies
color_quant = { version = "1.1", optional = true }
dav1d = { version = "0.10.2", optional = true }
dcv-color-primitives = { version = "0.6.1", optional = true }
color_quant = "1.1"
exr = { version = "1.5.0", optional = true }
gif = { version = "0.13", optional = true }
image-webp = { version = "0.1.0", optional = true }
mp4parse = { version = "0.17.0", optional = true }
png = { version = "0.17.6", optional = true }
qoi = { version = "0.4", optional = true }
libwebp = { package = "webp", version = "0.2.2", default-features = false, optional = true }
ravif = { version = "0.11.2", default-features = false, optional = true }
rayon = { version = "1.7.0", optional = true }
rgb = { version = "0.8.25", optional = true }
tiff = { version = "0.9.0", optional = true }
zune-core = { version = "0.4.11", default-features = false, optional = true }
zune-jpeg = { version = "0.4.11", optional = true }

[dev-dependencies]
crc32fast = "1.2.0"
num-complex = "0.4"
glob = "0.3"
quickcheck = "1"
criterion = "0.5.0"
# Keep this in sync with the jpeg dependency above. This is used to enable the platform_independent
# feature when testing, so `cargo test` works correctly.
jpeg = { package = "jpeg-decoder", version = "0.3.0", default-features = false, features = ["platform_independent"] }

[features]
# TODO: Add "avif" to this list while preparing for 0.24.0
default = ["gif", "jpeg", "ico", "png", "pnm", "tga", "tiff", "webp", "bmp", "hdr", "dxt", "dds", "farbfeld", "jpeg_rayon", "openexr", "qoi"]
default = ["rayon", "default-formats"]

ico = ["bmp", "png"]
pnm = []
tga = []
# Format features
default-formats = ["avif", "bmp", "dds", "exr", "ff", "gif", "hdr", "ico", "jpeg", "png", "pnm", "qoi", "tga", "tiff", "webp"]
avif = ["dep:ravif", "dep:rgb"]
bmp = []
dds = []
exr = ["dep:exr"]
ff = [] # Farbfeld image format
gif = ["dep:gif", "dep:color_quant"]
hdr = []
dxt = []
dds = ["dxt"]
farbfeld = []
openexr = ["exr"]
ico = ["bmp", "png"]
jpeg = ["dep:zune-core", "dep:zune-jpeg"]
png = ["dep:png"]
pnm = []
qoi = ["dep:qoi"]
tga = []
tiff = ["dep:tiff"]
webp = ["dep:image-webp"]

# Enables WebP decoder support.
webp = []
# Non-default, not included in `webp`. Requires native dependency libwebp.
webp-encoder = ["libwebp", "webp"]

# Enables multi-threading.
# Requires latest stable Rust.
jpeg_rayon = ["jpeg/rayon"]
# Non-default, enables avif support.
# Requires latest stable Rust.
avif = ["avif-encoder"]
# Requires latest stable Rust and recent nasm (>= 2.14).
avif-encoder = ["ravif", "rgb"]
# Non-default, even in `avif`. Requires stable Rust and native dependency libdav1d.
avif-decoder = ["mp4parse", "dcv-color-primitives", "dav1d"]

# Build some inline benchmarks. Useful only during development.
# Requires rustc nightly for feature test.
benchmarks = []
# Other features
rayon = ["dep:rayon"] # Enables multi-threading
avif-native = ["dep:mp4parse", "dep:dcv-color-primitives", "dep:dav1d"] # Enable native dependency libdav1d
benchmarks = [] # Build some inline benchmarks. Useful only during development (requires nightly Rust)

[[bench]]
path = "benches/decode.rs"
Expand Down