diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 24e528025..62d978f55 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -10,7 +10,18 @@ on: jobs: msrv_stable: name: msrv_stable - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + build: [ ubuntu, macos, windows ] + include: + - build: ubuntu + os: ubuntu-latest + - build: macos + os: macos-latest + - build: windows + os: windows-latest + runs-on: ${{ matrix.os }} continue-on-error: true steps: - name: checkout_repo @@ -28,9 +39,84 @@ jobs: - name: install_nasm uses: ilammy/setup-nasm@v1 + - name: feature_dav1d_setup + uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: feature_dav1d_pip + run: | + pip install -U pip + pip install -U wheel setuptools + pip install -U meson ninja + + - name: feature_dav1d_build_david_ubuntu + if: ${{ matrix.build == 'ubuntu' }} + env: + DAV1D_DIR: libdav1d + LIB_PATH: lib/x86_64-linux-gnu + run: | + git clone --branch 1.5.0 --depth 1 https://code.videolan.org/videolan/dav1d.git + cd dav1d + meson build -Dprefix=$HOME/$DAV1D_DIR -Denable_tools=false -Denable_examples=false --buildtype release + ninja -C build + ninja -C build install + echo "PKG_CONFIG_PATH=$HOME/$DAV1D_DIR/$LIB_PATH/pkgconfig" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=$HOME/$DAV1D_DIR/$LIB_PATH" >> $GITHUB_ENV + + - name: feature_dav1d_build_david_macos + if: ${{ matrix.build == 'macos' }} + env: + DAV1D_DIR: libdav1d + LIB_PATH: lib + run: | + git clone --branch 1.5.0 --depth 1 https://code.videolan.org/videolan/dav1d.git + cd dav1d + meson build -Dprefix=$HOME/$DAV1D_DIR -Denable_tools=false -Denable_examples=false --buildtype release + ninja -C build + ninja -C build install + echo "PKG_CONFIG_PATH=$HOME/$DAV1D_DIR/$LIB_PATH/pkgconfig" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=$HOME/$DAV1D_DIR/$LIB_PATH" >> $GITHUB_ENV + + - uses: ilammy/msvc-dev-cmd@v1 + if: ${{ matrix.build == 'windows' }} + + - name: feature_dav1d_build_david_windows_env + if: ${{ matrix.build == 'windows' }} + shell: bash + run: | + echo "PKG_CONFIG=c:\build\bin\pkg-config.exe" >> $GITHUB_ENV + echo "PKG_CONFIG_PATH=C:\build\lib\pkgconfig" >> $GITHUB_ENV + echo "C:\build\bin" >> $GITHUB_PATH + + - name: feature_dav1d_build_david_windows_pkg_config + if: ${{ matrix.build == 'windows' }} + run: | + git clone --branch meson-glib-subproject --depth 1 https://gitlab.freedesktop.org/tpm/pkg-config.git + cd pkg-config + meson build -Dprefix=C:\build --buildtype release + ninja -C build + ninja -C build install + + - name: feature_dav1d_build_david_windows + if: ${{ matrix.build == 'windows' }} + run: | + git clone --branch 1.5.0 --depth 1 https://code.videolan.org/videolan/dav1d.git + cd dav1d + meson build -Dprefix=C:\build -Denable_tools=false -Denable_examples=false --buildtype release + ninja -C build + ninja -C build install + - name: run_cargo_msrv_verify run: cargo msrv verify --output-format json - name: run_cargo_msrv_on_verify_failure if: ${{ failure() }} run: cargo msrv find --output-format json + + - name: run_cargo_msrv_verify + run: cargo msrv verify --features dav1d --output-format json + + - name: run_cargo_msrv_on_verify_failure + if: ${{ failure() }} + run: cargo msrv find --features dav1d --output-format json diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bee5db78..dd0e6ef82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,11 +27,11 @@ changes. ### Notable dependency updates -- Updated [image](https://github.com/image-rs/image) to 0.25.2 +- Updated [image](https://github.com/image-rs/image) to 0.25.5 ### Disabled -- Disabled AVIF decoder for now due to cross-platform compilation issues (dav1d-rs). +- Disabled AVIF decoder by default due to cross-platform compilation issues (enable on compile time using feature "dav1d"; requires libdav1d to be present). ## [0.22.4] - 2023-09-17 diff --git a/Cargo.lock b/Cargo.lock index 7e82db31e..54f4ba2f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -24,6 +24,18 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -103,6 +115,19 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "av-data" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fca67ba5d317924c02180c576157afd54babe48a76ebc66ce6d34bb8ba08308e" +dependencies = [ + "byte-slice-cast", + "bytes", + "num-derive", + "num-rational", + "num-traits", +] + [[package]] name = "av1-grain" version = "0.2.3" @@ -138,6 +163,21 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "bitreader" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "886559b1e163d56c765bc3a985febb4eee8009f625244511d8ee3c432e08c066" +dependencies = [ + "cfg-if", +] + [[package]] name = "bitstream-io" version = "2.6.0" @@ -175,6 +215,12 @@ version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + [[package]] name = "bytemuck" version = "1.21.0" @@ -193,6 +239,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" +[[package]] +name = "bytes" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" + [[package]] name = "cc" version = "1.2.6" @@ -228,7 +280,7 @@ checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ "ansi_term", "atty", - "bitflags", + "bitflags 1.3.2", "strsim", "textwrap", "unicode-width", @@ -300,6 +352,28 @@ dependencies = [ "typenum", ] +[[package]] +name = "dav1d" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d4b54a40baf633a71c6f0fb49494a7e4ee7bc26f3e727212b6cb915aa1ea1e1" +dependencies = [ + "av-data", + "bitflags 2.6.0", + "dav1d-sys", + "static_assertions", +] + +[[package]] +name = "dav1d-sys" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ecb1c5e8f4dc438eedc1b534a54672fb0e0a56035dae6b50162787bd2c50e95" +dependencies = [ + "libc", + "system-deps", +] + [[package]] name = "digest" version = "0.10.7" @@ -337,6 +411,15 @@ dependencies = [ "zune-inflate", ] +[[package]] +name = "fallible_collections" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a88c69768c0a15262df21899142bc6df9b9b823546d4b4b9a7bc2d6c448ec6fd" +dependencies = [ + "hashbrown 0.13.2", +] + [[package]] name = "fdeflate" version = "0.3.7" @@ -408,7 +491,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" dependencies = [ - "bitflags", + "bitflags 1.3.2", "ignore", "walkdir", ] @@ -429,6 +512,15 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + [[package]] name = "hashbrown" version = "0.14.5" @@ -475,9 +567,11 @@ dependencies = [ "bytemuck", "byteorder-lite", "color_quant", + "dav1d", "exr", "gif", "image-webp", + "mp4parse", "num-traits", "png", "qoi", @@ -692,6 +786,20 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "mp4parse" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63a35203d3c6ce92d5251c77520acb2e57108c88728695aa883f70023624c570" +dependencies = [ + "bitreader", + "byteorder", + "fallible_collections", + "log", + "num-traits", + "static_assertions", +] + [[package]] name = "nalgebra" version = "0.32.6" @@ -939,7 +1047,7 @@ version = "0.17.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" dependencies = [ - "bitflags", + "bitflags 1.3.2", "crc32fast", "fdeflate", "flate2", @@ -1339,6 +1447,12 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "strsim" version = "0.8.0" diff --git a/Cargo.toml b/Cargo.toml index e42319cf1..c1037f703 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ keywords = ["image", "converter", "cli", "front-end", "image-cli"] categories = ["multimedia::images", "command-line-utilities"] edition = "2021" -rust-version = "1.79" +rust-version = "1.80" [package.metadata.release] tag-prefix = "" @@ -56,6 +56,7 @@ yare = "3" default = ["imageproc-ops", "nasm"] imageproc-ops = ["sic_core/imageproc-ops", "sic_cli_ops/imageproc-ops", "sic_image_engine/imageproc-ops", "sic_parser/imageproc-ops"] nasm = ["sic_core/nasm"] +dav1d = ["sic_core/dav1d"] output-test-images = [] diff --git a/crates/sic_core/Cargo.toml b/crates/sic_core/Cargo.toml index bbe06d6da..cbcdbe9bf 100644 --- a/crates/sic_core/Cargo.toml +++ b/crates/sic_core/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/foresterre/sic" readme = "../../README.md" edition = "2021" -rust-version = "1.61" +rust-version = "1.80" [dependencies] image = { version = "0.25.5", features = ["rayon"] } @@ -18,4 +18,5 @@ thiserror = "2" [features] nasm = ["image/nasm"] +dav1d = ["image/avif-native"] imageproc-ops = ["imageproc", "ab_glyph"] diff --git a/deny.toml b/deny.toml index 623f6ff23..66f35065d 100644 --- a/deny.toml +++ b/deny.toml @@ -25,3 +25,7 @@ expression = "BSD-3-Clause" license-files = [ { path = "LICENSE.md", hash = 0xf0600744 }, ] + +[[licenses.exceptions]] +allow = ["MPL-2.0"] +name = "mp4parse"