From c27251aa9db80e70cc59bed9e9548a4d2e0da876 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 11 Oct 2024 11:10:13 +0100 Subject: [PATCH] support animated JXL --- .github/workflows/codespell.yml | 16 +++++ .github/workflows/run_unit_tests.yml | 92 ++++++++++++++++++++++++++++ CHANGELOG.md | 1 + src/tilesource.c | 3 +- 4 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/codespell.yml create mode 100644 .github/workflows/run_unit_tests.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..a877b95 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,16 @@ +name: Codespell + +on: [push, pull_request] + +permissions: {} + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Codespell + uses: codespell-project/actions-codespell@v2 diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml new file mode 100644 index 0000000..835693d --- /dev/null +++ b/.github/workflows/run_unit_tests.yml @@ -0,0 +1,92 @@ +name: build and test + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + name: Build and run tests + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + cc: gcc + - os: macos-latest + cc: clang + - os: windows-latest + cc: clang + - os: windows-latest + cc: cl + steps: + - uses: actions/checkout@v4 + + - name: Install build and test dependencies (Linux) + if: startsWith(matrix.os, 'ubuntu') + run: | + export DEBIAN_FRONTEND=noninteractive + export DEBCONF_NONINTERACTIVE_SEEN=true + sudo apt-get update + sudo apt-get install -y --no-install-suggests --no-install-recommends \ + build-essential \ + check \ + clang \ + llvm \ + meson \ + pkg-config \ + uthash-dev \ + valgrind + sudo apt-get clean + + - name: Install build and test dependencies (macOS) + if: startsWith(matrix.os, 'macos') + run: brew install check meson uthash + + - name: Install build and test dependencies (Windows) + if: startsWith(matrix.os, 'windows') + run: pip install meson ninja + + - name: Build and install library + shell: bash + run: | + export CC=${{ matrix.cc }} + sudo= + case "${{ matrix.os }}" in + ubuntu*) + sudo=sudo + ;; + windows*) + case "${{ matrix.cc }}" in + cl) + # ignore CK_DIAGNOSTIC_POP warnings in check + setup_args="--vsenv -Dcheck:werror=false" + ;; + clang) + # Ignore unused parameter warnings from check.h + export CFLAGS=-Wno-unused-parameter + # https://github.com/mesonbuild/meson/issues/10022 + export CC_LD=lld-link + ;; + esac + ;; + esac + meson setup builddir --werror $setup_args + DEBUG_DICT=1 meson compile -C builddir + $sudo meson install -C builddir + + - name: Run unit tests + # Don't run tests for private copy of Check + run: meson test -C builddir --suite libdicom + + - name: Print unit test logs + if: always() + run: cat builddir/meson-logs/testlog.txt + + - name: Run valgrind + if: startsWith(matrix.os, 'ubuntu') + run: | + valgrind --leak-check=full dcm-dump ./data/test_files/sm_image.dcm > /dev/null diff --git a/CHANGELOG.md b/CHANGELOG.md index 22c0722..5ef849c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - better behaviour for image interpretations like MATRIX - window menu has next-image / prev-image in the top line [euzada] - add "preserve view settings on new image" +- add animated JXL support # 3.0.4 1/3/24 diff --git a/src/tilesource.c b/src/tilesource.c index f90e44d..8aa5b9a 100644 --- a/src/tilesource.c +++ b/src/tilesource.c @@ -165,7 +165,8 @@ tilesource_open(Tilesource *tilesource, int level) NULL); } else if (vips_isprefix("webp", tilesource->loader) || - vips_isprefix("gif", tilesource->loader)) { + vips_isprefix("gif", tilesource->loader) || + vips_isprefix("jxl", tilesource->loader)) { /* These formats have pages all the same size and support page and n. */ image = vips_image_new_from_file(tilesource->filename,