From 7682c0377496ea2df6302863bb1183632fbd71e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:36:12 -0700 Subject: [PATCH 01/35] Bump actions/cache from 4.0.0 to 4.0.2 (#1698) Bumps [actions/cache](https://github.com/actions/cache) from 4.0.0 to 4.0.2. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v4.0.0...v4.0.2) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/bazel_build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bazel_build.yml b/.github/workflows/bazel_build.yml index 023dcfece6..1f6ecf26ea 100644 --- a/.github/workflows/bazel_build.yml +++ b/.github/workflows/bazel_build.yml @@ -48,7 +48,7 @@ jobs: - uses: actions/checkout@v4.1.1 - name: Mount Bazel cache - uses: actions/cache@v4.0.0 + uses: actions/cache@v4.0.2 with: path: "/home/runner/.cache/bazel" key: bazel-ubuntu-22 @@ -66,7 +66,7 @@ jobs: - uses: actions/checkout@v4.1.1 - name: Mount Bazel cache - uses: actions/cache@v4.0.0 + uses: actions/cache@v4.0.2 with: path: "/home/runner/.cache/bazel" key: bazel-windows-2022 @@ -84,7 +84,7 @@ jobs: - uses: actions/checkout@v4.1.1 - name: Mount Bazel cache - uses: actions/cache@v4.0.0 + uses: actions/cache@v4.0.2 with: path: "/home/runner/.cache/bazel" key: bazel-macos-13 @@ -102,7 +102,7 @@ jobs: - uses: actions/checkout@v4.1.1 - name: Mount Bazel cache - uses: actions/cache@v4.0.0 + uses: actions/cache@v4.0.2 with: path: "/home/runner/.cache/bazel" key: bazel-macos-14 From f7d33c4e564277b4862fcfce9e603f177d693f6d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:53:22 -0700 Subject: [PATCH 02/35] Bump actions/download-artifact from 4.0.0 to 4.1.4 (#1697) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.0.0 to 4.1.4. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4.0.0...v4.1.4) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/python-wheels-publish-test.yml | 6 +++--- .github/workflows/python-wheels-publish.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-wheels-publish-test.yml b/.github/workflows/python-wheels-publish-test.yml index cef33e9cc6..8eb98b25ce 100644 --- a/.github/workflows/python-wheels-publish-test.yml +++ b/.github/workflows/python-wheels-publish-test.yml @@ -84,17 +84,17 @@ jobs: steps: - name: Download Linux artifacts - uses: actions/download-artifact@v4.0.0 + uses: actions/download-artifact@v4.1.4 with: name: wheels-ubuntu-latest path: dist - name: Download macOS artifacts - uses: actions/download-artifact@v4.0.0 + uses: actions/download-artifact@v4.1.4 with: name: wheels-macos-latest path: dist - name: Download Windows artifacts - uses: actions/download-artifact@v4.0.0 + uses: actions/download-artifact@v4.1.4 with: name: wheels-windows-latest path: dist diff --git a/.github/workflows/python-wheels-publish.yml b/.github/workflows/python-wheels-publish.yml index 2330847df3..5cf11b1e1d 100644 --- a/.github/workflows/python-wheels-publish.yml +++ b/.github/workflows/python-wheels-publish.yml @@ -78,17 +78,17 @@ jobs: steps: - name: Download Linux artifacts - uses: actions/download-artifact@v4.0.0 + uses: actions/download-artifact@v4.1.4 with: name: wheels-ubuntu-latest path: dist - name: Download macOS artifacts - uses: actions/download-artifact@v4.0.0 + uses: actions/download-artifact@v4.1.4 with: name: wheels-macos-latest path: dist - name: Download Windows artifacts - uses: actions/download-artifact@v4.0.0 + uses: actions/download-artifact@v4.1.4 with: name: wheels-windows-latest path: dist From 133012a29efb19f51124345cc5d5dce26f485d4e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:54:57 -0700 Subject: [PATCH 03/35] Bump pypa/cibuildwheel from 2.16 to 2.17 (#1696) Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.16 to 2.17. - [Release notes](https://github.com/pypa/cibuildwheel/releases) - [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md) - [Commits](https://github.com/pypa/cibuildwheel/compare/v2.16...v2.17) --- updated-dependencies: - dependency-name: pypa/cibuildwheel dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/python-wheels-publish-test.yml | 2 +- .github/workflows/python-wheels-publish.yml | 2 +- .github/workflows/python-wheels.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-wheels-publish-test.yml b/.github/workflows/python-wheels-publish-test.yml index 8eb98b25ce..55fc42c292 100644 --- a/.github/workflows/python-wheels-publish-test.yml +++ b/.github/workflows/python-wheels-publish-test.yml @@ -48,7 +48,7 @@ jobs: run: pipx run build --sdist . --outdir wheelhouse - name: Build wheel - uses: pypa/cibuildwheel@v2.16 + uses: pypa/cibuildwheel@v2.17 with: output-dir: wheelhouse env: diff --git a/.github/workflows/python-wheels-publish.yml b/.github/workflows/python-wheels-publish.yml index 5cf11b1e1d..33f7cf4a62 100644 --- a/.github/workflows/python-wheels-publish.yml +++ b/.github/workflows/python-wheels-publish.yml @@ -42,7 +42,7 @@ jobs: run: pipx run build --sdist . --outdir wheelhouse - name: Build wheel - uses: pypa/cibuildwheel@v2.16 + uses: pypa/cibuildwheel@v2.17 with: output-dir: wheelhouse env: diff --git a/.github/workflows/python-wheels.yml b/.github/workflows/python-wheels.yml index 516af01390..be58d24269 100644 --- a/.github/workflows/python-wheels.yml +++ b/.github/workflows/python-wheels.yml @@ -55,7 +55,7 @@ jobs: run: pipx run build --sdist . --outdir wheelhouse - name: Build wheel - uses: pypa/cibuildwheel@v2.16 + uses: pypa/cibuildwheel@v2.17 env: CIBW_ARCHS_MACOS: x86_64 arm64 universal2 # Skip python 3.6 since scikit-build-core requires 3.7+ From cf1e57c01e2bad7ff6a4b569738bbc1af60ce895 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:55:37 -0700 Subject: [PATCH 04/35] Bump github/codeql-action from 2.2.4 to 3.24.9 (#1695) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.4 to 3.24.9. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/17573ee1cc1b9d061760f3a006fc4aac4f944fd5...1b1aada464948af03b950897e5eb522f92603cc2) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 4029c930d6..9827027807 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -51,6 +51,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4 + uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9 with: sarif_file: results.sarif From 0084673f97a664ef509105f5e7f0820494f4b21e Mon Sep 17 00:00:00 2001 From: Reini Urban Date: Sat, 6 Apr 2024 01:05:28 +0200 Subject: [PATCH 05/35] website: fix whitespace typo (#1706) Signed-off-by: Reini Urban --- website/bin/exrmultipart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/bin/exrmultipart.rst b/website/bin/exrmultipart.rst index 0a9caebb45..6104361530 100644 --- a/website/bin/exrmultipart.rst +++ b/website/bin/exrmultipart.rst @@ -7,7 +7,7 @@ exrmultipart :: - exrmultipart-combine -i input.exr[:partnum][::partname] [input2.exr[:partnum]][::partname] [...] -o outfile.exr [options] + exrmultipart -combine -i input.exr[:partnum][::partname] [input2.exr[:partnum]][::partname] [...] -o outfile.exr [options] or: exrmultipart -separate -i infile.exr -o outfileBaseName [options] From 063149e8e23d4ed2e9ac5d02e57003a12ebf829b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 17:26:42 -0700 Subject: [PATCH 06/35] Bump github/codeql-action from 3.24.9 to 3.24.10 (#1710) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.9 to 3.24.10. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/1b1aada464948af03b950897e5eb522f92603cc2...4355270be187e1b672a7a1c7c7bae5afdc1ab94a) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 9827027807..24c16cb39a 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -51,6 +51,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9 + uses: github/codeql-action/upload-sarif@4355270be187e1b672a7a1c7c7bae5afdc1ab94a # v3.24.10 with: sarif_file: results.sarif From 6c12cc157708ea4793e72c43719fa19688729d01 Mon Sep 17 00:00:00 2001 From: Cary Phillips Date: Mon, 8 Apr 2024 17:27:08 -0700 Subject: [PATCH 07/35] Create codeql.yml (#1709) Signed-off-by: Cary Phillips --- .github/workflows/codeql.yml | 91 ++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000000..39893fb030 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,91 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "main", "**/**" ] + pull_request: + branches: [ "main", "**/**" ] + schedule: + - cron: '37 10 * * 0' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + permissions: + # required for all workflows + security-events: write + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: c-cpp + build-mode: autobuild + - language: python + build-mode: none + # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' + # Use `c-cpp` to analyze code written in C, C++ or both + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + # If the analyze step fails for one of the languages you are analyzing with + # "We were unable to automatically build your code", modify the matrix above + # to set the build mode to "manual" for that language. Then modify this step + # to build your code. + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - if: matrix.build-mode == 'manual' + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" From 7a31cd59534f559aa045773900feefb899331a1a Mon Sep 17 00:00:00 2001 From: StepSecurity Bot Date: Mon, 8 Apr 2024 17:27:49 -0700 Subject: [PATCH 08/35] [StepSecurity] ci: Harden GitHub Actions (#1707) Signed-off-by: StepSecurity Bot --- .github/workflows/analysis_workflow.yml | 6 +++--- .github/workflows/bazel_build.yml | 16 ++++++++-------- .github/workflows/ci_workflow.yml | 6 +++--- .github/workflows/ossfuzz_workflow.yml | 6 +++--- .github/workflows/python-wheels-publish-test.yml | 16 ++++++++-------- .github/workflows/python-wheels-publish.yml | 16 ++++++++-------- .github/workflows/python-wheels.yml | 8 ++++---- .github/workflows/release-notice.yml | 4 ++-- .github/workflows/release-sign.yml | 4 ++-- .github/workflows/snyk-scan-cron.yml | 4 ++-- .github/workflows/website.yml | 2 +- .github/workflows/website_preview_link.yml | 2 +- 12 files changed, 45 insertions(+), 45 deletions(-) diff --git a/.github/workflows/analysis_workflow.yml b/.github/workflows/analysis_workflow.yml index 0423a7d4e5..978ca2aa7c 100644 --- a/.github/workflows/analysis_workflow.yml +++ b/.github/workflows/analysis_workflow.yml @@ -39,7 +39,7 @@ jobs: - name: Setup container run: sudo rm -rf /usr/local/lib64/cmake/glew - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 with: fetch-depth: 50 - name: Create build directories @@ -109,7 +109,7 @@ jobs: - name: Setup container run: sudo rm -rf /usr/local/lib64/cmake/glew - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 with: fetch-depth: 50 - name: Create build directories @@ -188,7 +188,7 @@ jobs: - name: Setup container run: sudo rm -rf /usr/local/lib64/cmake/glew - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 with: fetch-depth: 50 - name: Create build directories diff --git a/.github/workflows/bazel_build.yml b/.github/workflows/bazel_build.yml index 1f6ecf26ea..f011fe438e 100644 --- a/.github/workflows/bazel_build.yml +++ b/.github/workflows/bazel_build.yml @@ -45,10 +45,10 @@ jobs: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4.1.1 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Mount Bazel cache - uses: actions/cache@v4.0.2 + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 with: path: "/home/runner/.cache/bazel" key: bazel-ubuntu-22 @@ -63,10 +63,10 @@ jobs: runs-on: windows-2022 steps: - - uses: actions/checkout@v4.1.1 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Mount Bazel cache - uses: actions/cache@v4.0.2 + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 with: path: "/home/runner/.cache/bazel" key: bazel-windows-2022 @@ -81,10 +81,10 @@ jobs: runs-on: macos-13 steps: - - uses: actions/checkout@v4.1.1 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Mount Bazel cache - uses: actions/cache@v4.0.2 + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 with: path: "/home/runner/.cache/bazel" key: bazel-macos-13 @@ -99,10 +99,10 @@ jobs: runs-on: macos-14 steps: - - uses: actions/checkout@v4.1.1 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Mount Bazel cache - uses: actions/cache@v4.0.2 + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 with: path: "/home/runner/.cache/bazel" key: bazel-macos-14 diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index 746f67951d..92e4db3baf 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -225,7 +225,7 @@ jobs: CC: ${{ matrix.cc-compiler }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - name: Create build directories run: | mkdir _install @@ -359,7 +359,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - name: Create build directories run: | mkdir _install @@ -487,7 +487,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - name: Create build directories run: | mkdir _install diff --git a/.github/workflows/ossfuzz_workflow.yml b/.github/workflows/ossfuzz_workflow.yml index 6fbc043b69..9a7dea5492 100644 --- a/.github/workflows/ossfuzz_workflow.yml +++ b/.github/workflows/ossfuzz_workflow.yml @@ -41,20 +41,20 @@ jobs: steps: - name: Build Fuzzers id: build - uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master + uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@32f1d4deadc82279ec9001a837f2424e185c69a2 # master with: oss-fuzz-project-name: 'openexr' dry-run: false language: c++ - name: Run Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master + uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@32f1d4deadc82279ec9001a837f2424e185c69a2 # master with: oss-fuzz-project-name: 'openexr' fuzz-seconds: 300 dry-run: false language: c++ - name: Upload Crash - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 if: failure() && steps.build.outcome == 'success' with: name: artifacts diff --git a/.github/workflows/python-wheels-publish-test.yml b/.github/workflows/python-wheels-publish-test.yml index 55fc42c292..300b91b916 100644 --- a/.github/workflows/python-wheels-publish-test.yml +++ b/.github/workflows/python-wheels-publish-test.yml @@ -33,10 +33,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Install Python - uses: actions/setup-python@v5 + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 with: python-version: '3.x' @@ -48,7 +48,7 @@ jobs: run: pipx run build --sdist . --outdir wheelhouse - name: Build wheel - uses: pypa/cibuildwheel@v2.17 + uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # v2.17.0 with: output-dir: wheelhouse env: @@ -62,7 +62,7 @@ jobs: CIBW_ENVIRONMENT: OPENEXR_RELEASE_CANDIDATE_TAG="${{ github.ref_name }}" - name: Upload artifact - uses: actions/upload-artifact@v4.0.0 + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 with: name: wheels-${{ matrix.os }} path: | @@ -84,21 +84,21 @@ jobs: steps: - name: Download Linux artifacts - uses: actions/download-artifact@v4.1.4 + uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: name: wheels-ubuntu-latest path: dist - name: Download macOS artifacts - uses: actions/download-artifact@v4.1.4 + uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: name: wheels-macos-latest path: dist - name: Download Windows artifacts - uses: actions/download-artifact@v4.1.4 + uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: name: wheels-windows-latest path: dist - name: Publish distribution đŸ“Ļ to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # release/v1 with: repository-url: https://test.pypi.org/legacy/ \ No newline at end of file diff --git a/.github/workflows/python-wheels-publish.yml b/.github/workflows/python-wheels-publish.yml index 33f7cf4a62..169a3c8554 100644 --- a/.github/workflows/python-wheels-publish.yml +++ b/.github/workflows/python-wheels-publish.yml @@ -29,10 +29,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Install Python - uses: actions/setup-python@v5 + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 with: python-version: '3.x' @@ -42,7 +42,7 @@ jobs: run: pipx run build --sdist . --outdir wheelhouse - name: Build wheel - uses: pypa/cibuildwheel@v2.17 + uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # v2.17.0 with: output-dir: wheelhouse env: @@ -56,7 +56,7 @@ jobs: CIBW_TEST_SKIP: "*arm64" - name: Upload artifact - uses: actions/upload-artifact@v4.0.0 + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 with: name: wheels-${{ matrix.os }} path: | @@ -78,19 +78,19 @@ jobs: steps: - name: Download Linux artifacts - uses: actions/download-artifact@v4.1.4 + uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: name: wheels-ubuntu-latest path: dist - name: Download macOS artifacts - uses: actions/download-artifact@v4.1.4 + uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: name: wheels-macos-latest path: dist - name: Download Windows artifacts - uses: actions/download-artifact@v4.1.4 + uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: name: wheels-windows-latest path: dist - name: Publish distribution đŸ“Ļ to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # release/v1 diff --git a/.github/workflows/python-wheels.yml b/.github/workflows/python-wheels.yml index be58d24269..36f58f509a 100644 --- a/.github/workflows/python-wheels.yml +++ b/.github/workflows/python-wheels.yml @@ -42,10 +42,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Install Python - uses: actions/setup-python@v5 + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 with: python-version: '3.x' @@ -55,7 +55,7 @@ jobs: run: pipx run build --sdist . --outdir wheelhouse - name: Build wheel - uses: pypa/cibuildwheel@v2.17 + uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # v2.17.0 env: CIBW_ARCHS_MACOS: x86_64 arm64 universal2 # Skip python 3.6 since scikit-build-core requires 3.7+ @@ -65,7 +65,7 @@ jobs: CIBW_TEST_SKIP: "*-macosx*arm64" - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: wheels-${{ matrix.os }} path: | diff --git a/.github/workflows/release-notice.yml b/.github/workflows/release-notice.yml index d59b801fc7..d56a893c73 100644 --- a/.github/workflows/release-notice.yml +++ b/.github/workflows/release-notice.yml @@ -25,7 +25,7 @@ jobs: slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }} slack_channel: "#release-announcements" project_logo: "https://artwork.aswf.io/projects/openexr/icon/color/openexr-icon-color.png" - uses: jmertic/slack-release-notifier@main + uses: jmertic/slack-release-notifier@fbbf40c3020ca7707ae09ff9160206381c592fd7 # main - name: 'Notify Slack #openexr' id: slack2 @@ -34,5 +34,5 @@ jobs: slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }} slack_channel: "#openexr" project_logo: "https://artwork.aswf.io/projects/openexr/icon/color/openexr-icon-color.png" - uses: jmertic/slack-release-notifier@main + uses: jmertic/slack-release-notifier@fbbf40c3020ca7707ae09ff9160206381c592fd7 # main \ No newline at end of file diff --git a/.github/workflows/release-sign.yml b/.github/workflows/release-sign.yml index a8d68fdc66..fd17ba130e 100644 --- a/.github/workflows/release-sign.yml +++ b/.github/workflows/release-sign.yml @@ -49,13 +49,13 @@ jobs: shell: bash - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 - name: Create archive run: git archive --format=tar.gz -o ${OPENEXR_TARBALL} --prefix ${OPENEXR_PREFIX} ${TAG} - name: Sign archive with Sigstore - uses: sigstore/gh-action-sigstore-python@v2.1.1 + uses: sigstore/gh-action-sigstore-python@61f6a500bbfdd9a2a339cf033e5421951fbc1cd2 # v2.1.1 with: inputs: ${{ env.OPENEXR_TARBALL }} diff --git a/.github/workflows/snyk-scan-cron.yml b/.github/workflows/snyk-scan-cron.yml index cd32f25ed1..143cb73de4 100644 --- a/.github/workflows/snyk-scan-cron.yml +++ b/.github/workflows/snyk-scan-cron.yml @@ -17,9 +17,9 @@ jobs: runs-on: ubuntu-latest if: github.repository == 'AcademySoftwareFoundation/openexr' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: snyk/actions/setup@master + - uses: snyk/actions/setup@8349f9043a8b7f0f3ee8885bf28f0b388d2446e8 # master id: snyk - name: Snyk version diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 4a7f9348ea..d29adcc630 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -54,7 +54,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - name: Create build directory run: mkdir _build - name: Install doxygen diff --git a/.github/workflows/website_preview_link.yml b/.github/workflows/website_preview_link.yml index 84600ceee2..595b86f131 100644 --- a/.github/workflows/website_preview_link.yml +++ b/.github/workflows/website_preview_link.yml @@ -27,7 +27,7 @@ jobs: pull-request-links: runs-on: ubuntu-latest steps: - - uses: readthedocs/actions/preview@v1 + - uses: readthedocs/actions/preview@cc0920454cf03ca8a3fbd3cbaa2ce2e509e70636 # v1.2 with: project-slug: "openexr" message-template: "Website preview: {docs-pr-index-url}" From 4bc6077fa660acba0c61143693cfdaf899764177 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 13:35:21 -0700 Subject: [PATCH 09/35] Bump actions/upload-artifact from 3.1.0 to 4.3.1 (#1713) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.0 to 4.3.1. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3.1.0...5d5d22a31266ced268874388b861e4b58bb5c2f3) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ossfuzz_workflow.yml | 2 +- .github/workflows/python-wheels-publish-test.yml | 2 +- .github/workflows/python-wheels-publish.yml | 2 +- .github/workflows/scorecard.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ossfuzz_workflow.yml b/.github/workflows/ossfuzz_workflow.yml index 9a7dea5492..977fbd95ac 100644 --- a/.github/workflows/ossfuzz_workflow.yml +++ b/.github/workflows/ossfuzz_workflow.yml @@ -54,7 +54,7 @@ jobs: dry-run: false language: c++ - name: Upload Crash - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 if: failure() && steps.build.outcome == 'success' with: name: artifacts diff --git a/.github/workflows/python-wheels-publish-test.yml b/.github/workflows/python-wheels-publish-test.yml index 300b91b916..4148c9c1a2 100644 --- a/.github/workflows/python-wheels-publish-test.yml +++ b/.github/workflows/python-wheels-publish-test.yml @@ -62,7 +62,7 @@ jobs: CIBW_ENVIRONMENT: OPENEXR_RELEASE_CANDIDATE_TAG="${{ github.ref_name }}" - name: Upload artifact - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: wheels-${{ matrix.os }} path: | diff --git a/.github/workflows/python-wheels-publish.yml b/.github/workflows/python-wheels-publish.yml index 169a3c8554..9d204b1fe0 100644 --- a/.github/workflows/python-wheels-publish.yml +++ b/.github/workflows/python-wheels-publish.yml @@ -56,7 +56,7 @@ jobs: CIBW_TEST_SKIP: "*arm64" - name: Upload artifact - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: wheels-${{ matrix.os }} path: | diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 24c16cb39a..f12ff87994 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -43,7 +43,7 @@ jobs: # Upload the results as artifacts (optional) - name: "Upload artifact" - uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: SARIF file path: results.sarif From da6b169cf0f2acbbb4aadb991726f33e10384cf0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 13:43:00 -0700 Subject: [PATCH 10/35] Bump sphinx from 5.3 to 7.2.6 (#1694) Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 5.3 to 7.2.6. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v5.3.0...v7.2.6) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- website/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/requirements.txt b/website/requirements.txt index 2bc15aaa88..762c493e91 100644 --- a/website/requirements.txt +++ b/website/requirements.txt @@ -1,3 +1,3 @@ -sphinx == 5.3 +sphinx == 7.2.6 breathe sphinx-press-theme From 9aa1484719444593f78c72ac82baaa47b343cce9 Mon Sep 17 00:00:00 2001 From: Cary Phillips Date: Tue, 9 Apr 2024 13:43:36 -0700 Subject: [PATCH 11/35] Improve filters for ossfuzz and bazel (#1703) Ignore changes to workflow files other than the one in question. Also, no point in filtering out old release branches and tags, since the workflow files don't exist there anyway. Signed-off-by: Cary Phillips --- .github/workflows/bazel_build.yml | 14 ++++---------- .github/workflows/ossfuzz_workflow.yml | 14 ++++---------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/.github/workflows/bazel_build.yml b/.github/workflows/bazel_build.yml index f011fe438e..9346a402a7 100644 --- a/.github/workflows/bazel_build.yml +++ b/.github/workflows/bazel_build.yml @@ -12,29 +12,23 @@ name: Bazel on: push: - branches-ignore: - - RB-2.* - tags-ignore: - - v1.* - - v2.* paths: - '**' - '!**.md' - '!website/**' - 'website/src/**' - '!src/wrappers/**' + - '!.github/workflows/**' + - '.github/workflows/bazel_build.yml' pull_request: - branches-ignore: - - RB-2.* - tags-ignore: - - v1.* - - v2.* paths: - '**' - '!**.md' - '!website/**' - 'website/src/**' - '!src/wrappers/**' + - '!.github/workflows/**' + - '.github/workflows/bazel_build.yml' permissions: contents: read diff --git a/.github/workflows/ossfuzz_workflow.yml b/.github/workflows/ossfuzz_workflow.yml index 977fbd95ac..ac383c1f07 100644 --- a/.github/workflows/ossfuzz_workflow.yml +++ b/.github/workflows/ossfuzz_workflow.yml @@ -8,29 +8,23 @@ name: OSS-Fuzz on: push: - branches-ignore: - - RB-2.* - tags-ignore: - - v1.* - - v2.* paths: - '**' - '!**.md' - '!website/**' - '!bazel/**' - '!src/wrappers/**' + - '!.github/workflows/**' + - '.github/workflows/ossfuzz_workflow.yml' pull_request: - branches-ignore: - - RB-2.* - tags-ignore: - - v1.* - - v2.* paths: - '**' - '!**.md' - '!website/**' - '!bazel/**' - '!src/wrappers/**' + - '!.github/workflows/**' + - '.github/workflows/ossfuzz_workflow.yml' permissions: contents: read From d669510fda59ac26dc183e8bc271208c0eb737ad Mon Sep 17 00:00:00 2001 From: Cary Phillips Date: Tue, 9 Apr 2024 13:48:49 -0700 Subject: [PATCH 12/35] Pin sphinx to 7.1.2 The build distro does not yet support 7.2+. 7.1 is the latest available. Signed-off-by: Cary Phillips --- website/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/requirements.txt b/website/requirements.txt index 762c493e91..94e4e67dfc 100644 --- a/website/requirements.txt +++ b/website/requirements.txt @@ -1,3 +1,3 @@ -sphinx == 7.2.6 +sphinx == 7.1.2 breathe sphinx-press-theme From 67614ffdc1a8d3e713a97de340b82091f9373fb7 Mon Sep 17 00:00:00 2001 From: Cary Phillips Date: Sun, 14 Apr 2024 15:30:29 -0700 Subject: [PATCH 13/35] Add test for example python code in the pypi README.md (#1716) Signed-off-by: Cary Phillips --- pyproject.toml | 12 ++++++++- src/wrappers/python/README.md | 3 +++ src/wrappers/python/tests/test_readme.py | 31 ++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/wrappers/python/tests/test_readme.py diff --git a/pyproject.toml b/pyproject.toml index 7303862b6f..68fc95da37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,16 @@ requires-python = ">=3.7" [project.optional-dependencies] test = ["pytest"] +[tool.pytest.ini_options] +minversion = "6.0" +addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"] +xfail_strict = true +log_cli_level = "INFO" +filterwarnings = [ + "error", +] +testpaths = ["tests"] + [tool.scikit-build] wheel.expand-macos-universal-tags = true sdist.exclude = [".github", "src/test", "src/examples", "website", "ASWF", "bazel", "share"] @@ -56,7 +66,7 @@ BUILD_SHARED_LIBS = 'OFF' CMAKE_POSITION_INDEPENDENT_CODE = 'ON' [tool.cibuildwheel] -test-command = "ctest -R PyOpenEXR" +test-command = "pytest -s {project}/src/wrappers/python/tests" test-extras = ["test"] test-skip = ["*universal2:arm64"] build-verbosity = 1 diff --git a/src/wrappers/python/README.md b/src/wrappers/python/README.md index d7c15c989a..9d5df89654 100644 --- a/src/wrappers/python/README.md +++ b/src/wrappers/python/README.md @@ -69,6 +69,9 @@ for more information. # Quick Start + + + The "hello, world" image writer: import OpenEXR diff --git a/src/wrappers/python/tests/test_readme.py b/src/wrappers/python/tests/test_readme.py new file mode 100644 index 0000000000..2bf3da8885 --- /dev/null +++ b/src/wrappers/python/tests/test_readme.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 + +# +# SPDX-License-Identifier: BSD-3-Clause +# Copyright Contributors to the OpenEXR Project. +# + +# This is the example code from src/wrappers/python/README.md + +def test_readme(): + + import OpenEXR, Imath + from array import array + + width = 10 + height = 10 + size = width * height + + h = OpenEXR.Header(width,height) + h['channels'] = {'R' : Imath.Channel(Imath.PixelType(Imath.PixelType.FLOAT)), + 'G' : Imath.Channel(Imath.PixelType(Imath.PixelType.FLOAT)), + 'B' : Imath.Channel(Imath.PixelType(Imath.PixelType.FLOAT)), + 'A' : Imath.Channel(Imath.PixelType(Imath.PixelType.FLOAT))} + o = OpenEXR.OutputFile("hello.exr", h) + r = array('f', [n for n in range(size*0,size*1)]).tobytes() + g = array('f', [n for n in range(size*1,size*2)]).tobytes() + b = array('f', [n for n in range(size*2,size*3)]).tobytes() + a = array('f', [n for n in range(size*3,size*4)]).tobytes() + channels = {'R' : r, 'G' : g, 'B' : b, 'A' : a} + o.writePixels(channels) + o.close() From 5b034db00ad13fabaa904d2bc9041b0bffac5e6c Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Tue, 16 Apr 2024 20:09:12 +1200 Subject: [PATCH 14/35] Add api for C++ integration Add additional API for querying information from the context for integration into the C++ code base. These should be reviewed prior to final release whether they need to persist or are only temporary Signed-off-by: Kimball Thurston --- src/lib/OpenEXRCore/base.c | 2 + src/lib/OpenEXRCore/chunk.c | 17 +++++++- src/lib/OpenEXRCore/context.c | 34 +++++++++++++++- src/lib/OpenEXRCore/internal_attr.h | 2 +- .../OpenEXRCore/internal_win32_file_impl.h | 20 ++-------- src/lib/OpenEXRCore/openexr_chunkio.h | 5 +++ src/lib/OpenEXRCore/openexr_context.h | 15 +++++-- src/lib/OpenEXRCore/openexr_errors.h | 3 +- src/lib/OpenEXRCore/openexr_part.h | 18 +++++++-- src/lib/OpenEXRCore/part.c | 40 +++++++++++++++++++ website/OpenEXRCoreAPI.rst | 4 +- 11 files changed, 129 insertions(+), 31 deletions(-) diff --git a/src/lib/OpenEXRCore/base.c b/src/lib/OpenEXRCore/base.c index 513e73ea2c..dda032bf66 100644 --- a/src/lib/OpenEXRCore/base.c +++ b/src/lib/OpenEXRCore/base.c @@ -49,6 +49,7 @@ static const char* the_error_code_names[] = { "EXR_ERR_ALREADY_WROTE_ATTRS", "EXR_ERR_BAD_CHUNK_LEADER", "EXR_ERR_CORRUPT_CHUNK", + "EXR_ERR_INCOMPLETE_CHUNK_TABLE", "EXR_ERR_INCORRECT_PART", "EXR_ERR_INCORRECT_CHUNK", "EXR_ERR_USE_SCAN_DEEP_WRITE", @@ -88,6 +89,7 @@ static const char* the_default_errors[] = { "File in write mode, but header already written, can no longer edit attributes", "Unexpected or corrupt values in data block leader vs computed value", "Corrupt data block data, unable to decode", + "Chunk offsets table not completely finished writing (incomplete file)", "Previous part not yet finished writing", "Invalid data block to write at this point", "Use deep scanline write with the sample count table arguments", diff --git a/src/lib/OpenEXRCore/chunk.c b/src/lib/OpenEXRCore/chunk.c index b7130f3062..d326d9be73 100644 --- a/src/lib/OpenEXRCore/chunk.c +++ b/src/lib/OpenEXRCore/chunk.c @@ -51,7 +51,7 @@ atomic_compare_exchange_strong ( /**************************************/ -static exr_result_t extract_chunk_table ( +exr_result_t extract_chunk_table ( exr_const_context_t ctxt, exr_const_priv_part_t part, uint64_t** chunktable, @@ -540,7 +540,20 @@ reconstruct_chunk_table ( return firstfailrv; } -static exr_result_t +exr_result_t +exr_get_chunk_table_offset ( + exr_const_context_t ctxt, int part_index, uint64_t* chunk_offset_out) +{ + EXR_READONLY_AND_DEFINE_PART (part_index); + + if (!chunk_offset_out) + return ctxt->standard_error (ctxt, EXR_ERR_INVALID_ARGUMENT); + + *chunk_offset_out = part->chunk_table_offset; + return EXR_ERR_SUCCESS; +} + +exr_result_t extract_chunk_table ( exr_const_context_t ctxt, exr_const_priv_part_t part, diff --git a/src/lib/OpenEXRCore/context.c b/src/lib/OpenEXRCore/context.c index 5222e98d3c..6b2c18818c 100644 --- a/src/lib/OpenEXRCore/context.c +++ b/src/lib/OpenEXRCore/context.c @@ -373,7 +373,6 @@ exr_result_t exr_get_file_name (exr_const_context_t ctxt, const char** name) { if (!ctxt) return EXR_ERR_MISSING_CONTEXT_ARG; - if (ctxt->mode == EXR_CONTEXT_WRITE) internal_exr_lock (ctxt); /* not changeable after construction, no locking needed */ if (name) @@ -383,6 +382,32 @@ exr_get_file_name (exr_const_context_t ctxt, const char** name) return EXR_ERR_SUCCESS; } + return ctxt->standard_error (ctxt, EXR_ERR_INVALID_ARGUMENT); +} + +/**************************************/ + +exr_result_t +exr_get_file_version_and_flags (exr_const_context_t ctxt, uint32_t* ver) +{ + if (!ctxt) return EXR_ERR_MISSING_CONTEXT_ARG; + if (ctxt->mode == EXR_CONTEXT_WRITE) internal_exr_lock (ctxt); + + if (ver) + { + uint32_t flags = ctxt->version; + + if (ctxt->is_multipart) flags |= EXR_MULTI_PART_FLAG; + if (ctxt->max_name_length > EXR_SHORTNAME_MAXLEN) + flags |= EXR_LONG_NAMES_FLAG; + if (ctxt->has_nonimage_data) flags |= EXR_NON_IMAGE_FLAG; + if (ctxt->is_singlepart_tiled) flags |= EXR_TILED_FLAG; + + *ver = flags; + if (ctxt->mode == EXR_CONTEXT_WRITE) internal_exr_unlock (ctxt); + return EXR_ERR_SUCCESS; + } + if (ctxt->mode == EXR_CONTEXT_WRITE) internal_exr_unlock (ctxt); return ctxt->standard_error (ctxt, EXR_ERR_INVALID_ARGUMENT); } @@ -523,7 +548,12 @@ exr_set_longname_support (exr_context_t ctxt, int onoff) oldval = ctxt->max_name_length; newval = EXR_SHORTNAME_MAXLEN; - if (onoff) newval = EXR_LONGNAME_MAXLEN; + if (onoff) + { + newval = EXR_LONGNAME_MAXLEN; + ctxt->version = 2; + } + else { ctxt->version = 1; } if (oldval > newval) { diff --git a/src/lib/OpenEXRCore/internal_attr.h b/src/lib/OpenEXRCore/internal_attr.h index 71ccd0add7..04eee725e6 100644 --- a/src/lib/OpenEXRCore/internal_attr.h +++ b/src/lib/OpenEXRCore/internal_attr.h @@ -9,7 +9,7 @@ #include "openexr_attr.h" #include "openexr_context.h" -/** +/** * @defgroup InternalAttributeFunctions Functions for manipulating attributes * * The functions are currently internal to the library and are not diff --git a/src/lib/OpenEXRCore/internal_win32_file_impl.h b/src/lib/OpenEXRCore/internal_win32_file_impl.h index ad8c3ce240..7e1e29cc52 100644 --- a/src/lib/OpenEXRCore/internal_win32_file_impl.h +++ b/src/lib/OpenEXRCore/internal_win32_file_impl.h @@ -21,7 +21,7 @@ static exr_result_t print_error_helper ( - exr_context_t pf, + exr_const_context_t pf, exr_result_t errcode, DWORD dw, exr_stream_error_func_ptr_t error_cb, @@ -60,11 +60,7 @@ print_error_helper ( } if (error_cb) - error_cb ( - (exr_const_context_t) pf, - errcode, - "%s", - (const char*) lpDisplayBuf); + error_cb (pf, errcode, "%s", (const char*) lpDisplayBuf); else pf->print_error (pf, errcode, "%s", (const char*) lpDisplayBuf); @@ -75,21 +71,11 @@ print_error_helper ( } static exr_result_t -print_error (exr_context_t pf, exr_result_t errcode, const char* msg) +print_error (exr_const_context_t pf, exr_result_t errcode, const char* msg) { return print_error_helper (pf, errcode, GetLastError (), NULL, msg); } -static exr_result_t -send_error ( - exr_context_t pf, - exr_result_t errcode, - exr_stream_error_func_ptr_t error_cb, - const char* msg) -{ - return print_error_helper (pf, errcode, GetLastError (), error_cb, msg); -} - static wchar_t* widen_filename (exr_context_t file, const char* fn) { diff --git a/src/lib/OpenEXRCore/openexr_chunkio.h b/src/lib/OpenEXRCore/openexr_chunkio.h index 35ed11b966..87bf15a318 100644 --- a/src/lib/OpenEXRCore/openexr_chunkio.h +++ b/src/lib/OpenEXRCore/openexr_chunkio.h @@ -16,6 +16,11 @@ extern "C" { /** @file */ +/** @brief Retrieve the chunk table offset for the part in question. + */ +EXR_EXPORT exr_result_t exr_get_chunk_table_offset ( + exr_const_context_t ctxt, int part_index, uint64_t* chunk_offset_out); + /** * Struct describing raw data information about a chunk. * diff --git a/src/lib/OpenEXRCore/openexr_context.h b/src/lib/OpenEXRCore/openexr_context.h index 195b99cf34..1a8b3b79ec 100644 --- a/src/lib/OpenEXRCore/openexr_context.h +++ b/src/lib/OpenEXRCore/openexr_context.h @@ -19,7 +19,7 @@ extern "C" { /** @file */ -/** +/** * @defgroup Context Context related definitions * * A context is a single instance of an OpenEXR file or stream. Beyond @@ -42,7 +42,7 @@ extern "C" { typedef struct _priv_exr_context_t* exr_context_t; typedef const struct _priv_exr_context_t* exr_const_context_t; -/** +/** * @defgroup ContextFunctions OpenEXR Context Stream/File Functions * * @brief These are a group of function interfaces used to customize @@ -125,6 +125,9 @@ typedef int64_t (*exr_query_size_func_ptr_t) ( * truly a stream, it is up to the provider to implement appropriate * caching of data to give the appearance of being able to seek/read * atomically. + * + * TODO: This does not handle the ability to mmap a file and get to + * zero copy */ typedef int64_t (*exr_read_func_ptr_t) ( exr_const_context_t ctxt, @@ -471,6 +474,12 @@ EXR_EXPORT exr_result_t exr_start_inplace_header_update ( EXR_EXPORT exr_result_t exr_get_file_name (exr_const_context_t ctxt, const char** name); +/** @brief Retrieve the file version and flags the context is for as + * parsed during the start routine. + */ +EXR_EXPORT exr_result_t +exr_get_file_version_and_flags (exr_const_context_t ctxt, uint32_t* ver); + /** @brief Query the user data the context was constructed with. This * is perhaps useful in the error handler callback to jump back into * an object the user controls. @@ -524,7 +533,7 @@ exr_set_longname_support (exr_context_t ctxt, int onoff); * metadata up front, prior to calling the above exr_start_write(), * allow the data to be set, then once this is called, it switches * into a mode where the library assumes the data is now valid. - * + * * It will recompute the number of chunks that will be written, and * reset the chunk offsets. If you modify file attributes or part * information after a call to this, it will error. diff --git a/src/lib/OpenEXRCore/openexr_errors.h b/src/lib/OpenEXRCore/openexr_errors.h index 2092a20f45..5d74b01f2c 100644 --- a/src/lib/OpenEXRCore/openexr_errors.h +++ b/src/lib/OpenEXRCore/openexr_errors.h @@ -16,7 +16,7 @@ extern "C" { /** @file */ -/** +/** * @defgroup ErrorCodes Error Handling * @brief These are a group of definitions related to error handling. * @@ -54,6 +54,7 @@ typedef enum EXR_ERR_ALREADY_WROTE_ATTRS, EXR_ERR_BAD_CHUNK_LEADER, EXR_ERR_CORRUPT_CHUNK, + EXR_ERR_INCOMPLETE_CHUNK_TABLE, EXR_ERR_INCORRECT_PART, EXR_ERR_INCORRECT_CHUNK, EXR_ERR_USE_SCAN_DEEP_WRITE, diff --git a/src/lib/OpenEXRCore/openexr_part.h b/src/lib/OpenEXRCore/openexr_part.h index 3a7b1196db..ca4d59b2e7 100644 --- a/src/lib/OpenEXRCore/openexr_part.h +++ b/src/lib/OpenEXRCore/openexr_part.h @@ -16,7 +16,7 @@ extern "C" { /** @file */ -/** +/** * @defgroup PartInfo Part related definitions. * * A part is a separate entity in the OpenEXR file. This was @@ -123,7 +123,7 @@ EXR_EXPORT exr_result_t exr_get_level_sizes ( * As in the technical documentation for OpenEXR, the chunk is the * generic term for a pixel data block. This is the atomic unit that * this library uses to negotiate data to and from a context. - * + * * This should be used as a basis for splitting up how a file is * processed. Depending on the compression, a different number of * scanlines are encoded in each chunk, and since those need to be @@ -133,6 +133,16 @@ EXR_EXPORT exr_result_t exr_get_level_sizes ( EXR_EXPORT exr_result_t exr_get_chunk_count (exr_const_context_t ctxt, int part_index, int32_t* out); +/** Return whether the chunk table for this part is completely written. + * + * This only validates that all the offsets are valid. + * + * return EXR_ERR_INCOMPLETE_CHUNK_TABLE when incomplete, EXR_ERR_SUCCESS + * if it appears ok, or another error if otherwise problematic + */ +EXR_EXPORT exr_result_t +exr_validate_chunk_table (exr_context_t ctxt, int part_index); + /** Return the number of scanlines chunks for this file part. * * When iterating over a scanline file, this may be an easier metric @@ -266,7 +276,7 @@ EXR_EXPORT exr_result_t exr_attr_declare ( exr_attribute_type_t type, exr_attribute_t** newattr); -/** +/** * @defgroup RequiredAttributeHelpers Required Attribute Utililities * * @brief These are a group of functions for attributes that are @@ -436,7 +446,7 @@ exr_set_chunk_count (exr_context_t ctxt, int part_index, int32_t val); /** @} */ /* required attr group. */ -/** +/** * @defgroup BuiltinAttributeHelpers Attribute utilities for builtin types * * @brief These are a group of functions for attributes that use the builtin types. diff --git a/src/lib/OpenEXRCore/part.c b/src/lib/OpenEXRCore/part.c index 07172b44a2..59ea9874eb 100644 --- a/src/lib/OpenEXRCore/part.c +++ b/src/lib/OpenEXRCore/part.c @@ -365,6 +365,46 @@ exr_get_chunk_count (exr_const_context_t ctxt, int part_index, int32_t* out) /**************************************/ +exr_result_t extract_chunk_table ( + exr_const_context_t ctxt, + exr_const_priv_part_t part, + uint64_t** chunktable, + uint64_t* chunkminoffset); + +exr_result_t +exr_validate_chunk_table (exr_context_t ctxt, int part_index) +{ + exr_result_t rv; + uint64_t chunkmin, maxoff = ((uint64_t) -1); + uint64_t* ctable; + int complete; + EXR_LOCK_WRITE_AND_DEFINE_PART (part_index); + + /* need to read from the file to get the packed chunk size */ + rv = extract_chunk_table (ctxt, part, &ctable, &chunkmin); + + if (rv != EXR_ERR_SUCCESS) return rv; + + if (ctxt->file_size > 0) maxoff = (uint64_t) ctxt->file_size; + complete = 1; + + for (int ci = 0; ci < part->chunk_count; ++ci) + { + uint64_t cchunk = ctable[ci]; + if (cchunk < chunkmin || cchunk >= maxoff) + { + complete = 0; + break; + } + } + + if (!complete) return EXR_ERR_INCOMPLETE_CHUNK_TABLE; + + return EXR_ERR_SUCCESS; +} + +/**************************************/ + exr_result_t exr_get_scanlines_per_chunk ( exr_const_context_t ctxt, int part_index, int32_t* out) diff --git a/website/OpenEXRCoreAPI.rst b/website/OpenEXRCoreAPI.rst index 90aaf856dd..7cb5bca711 100644 --- a/website/OpenEXRCoreAPI.rst +++ b/website/OpenEXRCoreAPI.rst @@ -221,6 +221,7 @@ Chunk Reading Chunks ^^^^^^ +.. doxygenfunction:: exr_get_chunk_table_offset .. doxygenstruct:: exr_chunk_info_t Chunk Writing @@ -260,12 +261,13 @@ Context .. doxygentypedef:: exr_context_t .. doxygentypedef:: exr_const_context_t - + .. doxygenstruct:: _exr_context_initializer_v3 :members: .. doxygentypedef:: exr_context_initializer_t .. doxygenfunction:: exr_get_file_name +.. doxygenfunction:: exr_get_file_version_and_flags .. doxygenfunction:: exr_get_user_data .. doxygenfunction:: exr_register_attr_type_handler From f38fb9d2c8db0cf34c1d95428b1f7e9a7d8063f3 Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Wed, 17 Apr 2024 00:47:50 +1200 Subject: [PATCH 15/35] Add missing deep image state attribute Not sure when that got added to the C++ library, but wasn't in the core Signed-off-by: Kimball Thurston --- src/lib/OpenEXRCore/attributes.c | 8 ++++++-- src/lib/OpenEXRCore/openexr_attr.h | 11 +++++++++++ src/lib/OpenEXRCore/parse_header.c | 10 ++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/lib/OpenEXRCore/attributes.c b/src/lib/OpenEXRCore/attributes.c index 4c740354e5..4d59e13438 100644 --- a/src/lib/OpenEXRCore/attributes.c +++ b/src/lib/OpenEXRCore/attributes.c @@ -55,7 +55,8 @@ static struct _internal_exr_attr_map the_predefined_attr_typenames[] = { {"v2d", 3, EXR_ATTR_V2D, sizeof (exr_attr_v2d_t)}, {"v3i", 3, EXR_ATTR_V3I, sizeof (exr_attr_v3i_t)}, {"v3f", 3, EXR_ATTR_V3F, sizeof (exr_attr_v3f_t)}, - {"v3d", 3, EXR_ATTR_V3D, sizeof (exr_attr_v3d_t)}}; + {"v3d", 3, EXR_ATTR_V3D, sizeof (exr_attr_v3d_t)}, + {"deepImageState", 14, EXR_ATTR_DEEP_IMAGE_STATE, 0}}; static int the_predefined_attr_count = sizeof (the_predefined_attr_typenames) / sizeof (struct _internal_exr_attr_map); @@ -88,7 +89,8 @@ attr_init (exr_context_t ctxt, exr_attribute_t* nattr) } case EXR_ATTR_COMPRESSION: case EXR_ATTR_ENVMAP: - case EXR_ATTR_LINEORDER: nattr->uc = 0; break; + case EXR_ATTR_LINEORDER: + case EXR_ATTR_DEEP_IMAGE_STATE: nattr->uc = 0; break; case EXR_ATTR_DOUBLE: nattr->d = 0.0; break; case EXR_ATTR_FLOAT: nattr->f = 0.0f; break; case EXR_ATTR_FLOAT_VECTOR: { @@ -250,6 +252,7 @@ attr_destroy (exr_context_t ctxt, exr_attribute_t* attr) case EXR_ATTR_V3I: case EXR_ATTR_V3F: case EXR_ATTR_V3D: + case EXR_ATTR_DEEP_IMAGE_STATE: case EXR_ATTR_UNKNOWN: case EXR_ATTR_LAST_KNOWN_TYPE: default: break; @@ -375,6 +378,7 @@ exr_attr_list_compute_size ( case EXR_ATTR_V3I: retval += sizeof (*(cur->v3i)); break; case EXR_ATTR_V3F: retval += sizeof (*(cur->v3f)); break; case EXR_ATTR_V3D: retval += sizeof (*(cur->v3d)); break; + case EXR_ATTR_DEEP_IMAGE_STATE: retval += sizeof (uint8_t); break; case EXR_ATTR_OPAQUE: if (cur->opaque->packed_data) retval += (size_t) cur->opaque->size; diff --git a/src/lib/OpenEXRCore/openexr_attr.h b/src/lib/OpenEXRCore/openexr_attr.h index 7b01e4b350..bcc3c1c74b 100644 --- a/src/lib/OpenEXRCore/openexr_attr.h +++ b/src/lib/OpenEXRCore/openexr_attr.h @@ -101,6 +101,16 @@ typedef enum EXR_PIXEL_LAST_TYPE } exr_pixel_type_t; +/** Enum declaring allowed values for \c uint8_t value stored in \c deepImageState type. */ +typedef enum +{ + EXR_DIS_MESSY = 0, + EXR_DIS_SORTED = 1, + EXR_DIS_NON_OVERLAPPING = 2, + EXR_DIS_TIDY = 3, + EXR_DIS_LAST_TYPE /**< Invalid value, provided for range checking. */ +} exr_deep_image_state_t; + /* /////////////////////////////////////// */ /* First set of structs are data where we can read directly with no allocation needed... */ @@ -450,6 +460,7 @@ typedef enum EXR_ATTR_V3I, /**< Set of 3 32-bit integers. */ EXR_ATTR_V3F, /**< Set of 3 32-bit floats. */ EXR_ATTR_V3D, /**< Set of 3 64-bit floats. */ + EXR_ATTR_DEEP_IMAGE_STATE, /**< ``uint8_t`` declaring deep image state. */ EXR_ATTR_OPAQUE, /**< User/unknown provided type. */ EXR_ATTR_LAST_KNOWN_TYPE } exr_attribute_type_t; diff --git a/src/lib/OpenEXRCore/parse_header.c b/src/lib/OpenEXRCore/parse_header.c index 5eb78c69c9..3c75f5a8f4 100644 --- a/src/lib/OpenEXRCore/parse_header.c +++ b/src/lib/OpenEXRCore/parse_header.c @@ -2044,6 +2044,16 @@ pull_attr ( rv = extract_attr_64bit ( ctxt, scratch, nattr->v3d->arr, name, type, attrsz, 3); break; + case EXR_ATTR_DEEP_IMAGE_STATE: + rv = extract_attr_uint8 ( + ctxt, + scratch, + &(nattr->uc), + name, + type, + attrsz, + (uint8_t) EXR_DIS_LAST_TYPE); + break; case EXR_ATTR_OPAQUE: rv = extract_attr_opaque ( ctxt, scratch, nattr->opaque, name, type, attrsz); From e7f1099440c510b75d57770c1f8a5f5a471ac984 Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Wed, 17 Apr 2024 00:53:18 +1200 Subject: [PATCH 16/35] Fix flag handling and storage type validation to match Long name attribute flags was not being set correctly and the rules around when there is a mismatch between the bit flags in the header and the type attribute were not being correctly handled Signed-off-by: Kimball Thurston --- src/lib/OpenEXRCore/context.c | 14 ++--- src/lib/OpenEXRCore/internal_file.h | 1 + src/lib/OpenEXRCore/internal_structs.h | 3 +- src/lib/OpenEXRCore/parse_header.c | 58 +++++++++++-------- src/lib/OpenEXRCore/validation.c | 79 +++++++++++++++++++------- src/lib/OpenEXRCore/write_header.c | 68 ++++++++++++++++++++-- 6 files changed, 166 insertions(+), 57 deletions(-) diff --git a/src/lib/OpenEXRCore/context.c b/src/lib/OpenEXRCore/context.c index 6b2c18818c..9519f8a1ee 100644 --- a/src/lib/OpenEXRCore/context.c +++ b/src/lib/OpenEXRCore/context.c @@ -395,17 +395,15 @@ exr_get_file_version_and_flags (exr_const_context_t ctxt, uint32_t* ver) if (ver) { - uint32_t flags = ctxt->version; + exr_result_t ret = EXR_ERR_SUCCESS; - if (ctxt->is_multipart) flags |= EXR_MULTI_PART_FLAG; - if (ctxt->max_name_length > EXR_SHORTNAME_MAXLEN) - flags |= EXR_LONG_NAMES_FLAG; - if (ctxt->has_nonimage_data) flags |= EXR_NON_IMAGE_FLAG; - if (ctxt->is_singlepart_tiled) flags |= EXR_TILED_FLAG; + if (ctxt->orig_version_and_flags != 0) + *ver = ctxt->orig_version_and_flags; + else + ret = internal_exr_calc_header_version_flags (ctxt, ver); - *ver = flags; if (ctxt->mode == EXR_CONTEXT_WRITE) internal_exr_unlock (ctxt); - return EXR_ERR_SUCCESS; + return ret; } if (ctxt->mode == EXR_CONTEXT_WRITE) internal_exr_unlock (ctxt); diff --git a/src/lib/OpenEXRCore/internal_file.h b/src/lib/OpenEXRCore/internal_file.h index 504abe64e0..2b3d9ab280 100644 --- a/src/lib/OpenEXRCore/internal_file.h +++ b/src/lib/OpenEXRCore/internal_file.h @@ -26,6 +26,7 @@ exr_result_t internal_exr_compute_tile_information ( exr_context_t ctxt, exr_priv_part_t curpart, int rebuild); int32_t internal_exr_compute_chunk_offset_size (exr_priv_part_t curpart); +exr_result_t internal_exr_calc_header_version_flags (exr_const_context_t ctxt, uint32_t *flags); exr_result_t internal_exr_write_header (exr_context_t ctxt); /* in openexr_validate.c, functions to validate the header during read / pre-write */ diff --git a/src/lib/OpenEXRCore/internal_structs.h b/src/lib/OpenEXRCore/internal_structs.h index fcf7e1297b..cda21ea909 100644 --- a/src/lib/OpenEXRCore/internal_structs.h +++ b/src/lib/OpenEXRCore/internal_structs.h @@ -216,7 +216,8 @@ struct _priv_exr_context_t #endif uint8_t disable_chunk_reconstruct; uint8_t legacy_header; - uint8_t _pad[6]; + uint8_t _pad[2]; + uint32_t orig_version_and_flags; }; #define EXR_CONST_CAST(t, v) ((t) (uintptr_t) v) diff --git a/src/lib/OpenEXRCore/parse_header.c b/src/lib/OpenEXRCore/parse_header.c index 3c75f5a8f4..1018c61bdf 100644 --- a/src/lib/OpenEXRCore/parse_header.c +++ b/src/lib/OpenEXRCore/parse_header.c @@ -1596,13 +1596,25 @@ check_populate_type ( } if (strcmp ((const char*) outstr, "scanlineimage") == 0) - curpart->storage_mode = EXR_STORAGE_SCANLINE; + { + if (ctxt->has_nonimage_data || ctxt->is_multipart) + curpart->storage_mode = EXR_STORAGE_SCANLINE; + } else if (strcmp ((const char*) outstr, "tiledimage") == 0) - curpart->storage_mode = EXR_STORAGE_TILED; + { + if (ctxt->has_nonimage_data || ctxt->is_multipart) + curpart->storage_mode = EXR_STORAGE_TILED; + } else if (strcmp ((const char*) outstr, "deepscanline") == 0) - curpart->storage_mode = EXR_STORAGE_DEEP_SCANLINE; + { + if (ctxt->has_nonimage_data || ctxt->is_multipart) + curpart->storage_mode = EXR_STORAGE_DEEP_SCANLINE; + } else if (strcmp ((const char*) outstr, "deeptile") == 0) - curpart->storage_mode = EXR_STORAGE_DEEP_TILED; + { + if (ctxt->has_nonimage_data || ctxt->is_multipart) + curpart->storage_mode = EXR_STORAGE_DEEP_TILED; + } else { rv = ctxt->print_error ( @@ -2478,6 +2490,7 @@ read_magic_and_flags (exr_context_t ctxt, uint32_t* outflags, uint64_t* initpos) flags = magic_and_version[1]; + ctxt->orig_version_and_flags = flags; ctxt->version = flags & EXR_FILE_VERSION_MASK; if (ctxt->version != 2) { @@ -2571,27 +2584,26 @@ internal_exr_parse_header (exr_context_t ctxt) { if (ctxt->has_nonimage_data || ctxt->is_multipart) { - if (ctxt->strict_header) - { - rv = ctxt->print_error ( - ctxt, - EXR_ERR_FILE_BAD_HEADER, - "Invalid combination of version flags: single part found, but also marked as deep (%d) or multipart (%d)", - (int) ctxt->has_nonimage_data, - (int) ctxt->is_multipart); - priv_destroy_scratch (&scratch); - return internal_exr_context_restore_handlers (ctxt, rv); - } - else - { - // assume multipart for now - ctxt->is_singlepart_tiled = 0; - } + // this appears to always be fatal, so do not check strict / not + rv = ctxt->print_error ( + ctxt, + EXR_ERR_FILE_BAD_HEADER, + "Invalid combination of version flags: single part flag found, but also marked as deep (%d) or multipart (%d)", + (int) ctxt->has_nonimage_data, + (int) ctxt->is_multipart); + priv_destroy_scratch (&scratch); + return internal_exr_context_restore_handlers (ctxt, rv); } - curpart->storage_mode = EXR_STORAGE_TILED; } - else - curpart->storage_mode = EXR_STORAGE_SCANLINE; + + /* leave storage mode uninitialized until we encounter the type */ + if (!ctxt->has_nonimage_data && !ctxt->is_multipart) + { + if (ctxt->is_singlepart_tiled) + curpart->storage_mode = EXR_STORAGE_TILED; + else + curpart->storage_mode = EXR_STORAGE_SCANLINE; + } do { diff --git a/src/lib/OpenEXRCore/validation.c b/src/lib/OpenEXRCore/validation.c index 01fa0b33cf..8c08dd39a9 100644 --- a/src/lib/OpenEXRCore/validation.c +++ b/src/lib/OpenEXRCore/validation.c @@ -8,6 +8,7 @@ #include #include #include +#include /**************************************/ @@ -407,37 +408,77 @@ validate_part_type (exr_context_t f, exr_priv_part_t curpart) // TODO: there are probably more tests to add here... if (curpart->type) { - int rv; + const char *expectedtype = NULL; + exr_result_t rv; // see if the type overwrote the storage mode - if (f->is_singlepart_tiled && - curpart->storage_mode != EXR_STORAGE_TILED) + if (f->is_singlepart_tiled) { - // mismatch between type attr and file flag. c++ believed the - // flag first and foremost - curpart->storage_mode = EXR_STORAGE_TILED; - - // TODO: define how strict we should be - //exr_attr_list_remove( f, &(curpart->attributes), curpart->type ); - //curpart->type = NULL; - f->print_error ( - f, - EXR_ERR_INVALID_ATTR, - "attribute 'type': Mismatch between file flags and type string '%s', believing file flags", - curpart->type->string->str); + if (f->is_multipart || f->num_parts > 1) + return f->print_error ( + f, + EXR_ERR_INVALID_ATTR, + "Multipart files cannot have the tiled bit set"); + + if (curpart->storage_mode != EXR_STORAGE_TILED) + { + curpart->storage_mode = EXR_STORAGE_TILED; + + if (f->strict_header) + { + return f->print_error ( + f, + EXR_ERR_INVALID_ATTR, + "attribute 'type': Single part tiled flag set but not marked as tiled storage type"); + } + } + } + + if (curpart->storage_mode == EXR_STORAGE_SCANLINE) + expectedtype = "scanlineimage"; + else if (curpart->storage_mode == EXR_STORAGE_TILED) + expectedtype = "tiledimage"; + else if (curpart->storage_mode == EXR_STORAGE_DEEP_SCANLINE) + expectedtype = "deepscanline"; + else if (curpart->storage_mode == EXR_STORAGE_DEEP_TILED) + expectedtype = "deeptile"; + if (expectedtype && 0 != strcmp (curpart->type->string->str, expectedtype)) + { if (f->mode == EXR_CONTEXT_WRITE) return EXR_ERR_INVALID_ATTR; - rv = exr_attr_string_set_with_length ( - (exr_context_t) f, curpart->type->string, "tiledimage", 10); - if (rv != EXR_ERR_SUCCESS) + if (f->strict_header) + { return f->print_error ( f, EXR_ERR_INVALID_ATTR, - "attribute 'type': Mismatch between file flags and type attribute, unable to fix"); + "attribute 'type': Type should be '%s' but set to '%s', believing file flags", + expectedtype, + curpart->type->string->str); + } + else + { + /* C++ silently changed this */ + rv = exr_attr_string_set ( + f, curpart->type->string, expectedtype); + + if (rv != EXR_ERR_SUCCESS) + return f->print_error ( + f, + EXR_ERR_INVALID_ATTR, + "attribute 'type': Mismatch between file flags and type attribute, unable to fix"); + } } } + if (curpart->storage_mode == EXR_STORAGE_LAST_TYPE) + { + return f->print_error ( + f, + EXR_ERR_INVALID_ATTR, + "Unable to determine data storage type for part"); + } + return EXR_ERR_SUCCESS; } diff --git a/src/lib/OpenEXRCore/write_header.c b/src/lib/OpenEXRCore/write_header.c index f53aef35ad..bb0082eb9a 100644 --- a/src/lib/OpenEXRCore/write_header.c +++ b/src/lib/OpenEXRCore/write_header.c @@ -596,6 +596,67 @@ save_attr (exr_context_t ctxt, const exr_attribute_t* a) return rv; } +/**************************************/ + +exr_result_t internal_exr_calc_header_version_flags (exr_const_context_t ctxt, uint32_t *flags) +{ + *flags = 2; // EXR_VERSION + + if (ctxt->is_multipart) *flags |= EXR_MULTI_PART_FLAG; + + if (ctxt->max_name_length > EXR_SHORTNAME_MAXLEN) + { + int longnamefound = 0; + + for ( int p = 0; p < ctxt->num_parts; ++p ) + { + exr_priv_part_t curpart = ctxt->parts[p]; + for ( int a = 0; a < curpart->attributes.num_attributes; ++a ) + { + exr_attribute_t *cura = curpart->attributes.entries[a]; + if (cura->name_length > EXR_SHORTNAME_MAXLEN || + cura->type_name_length > EXR_SHORTNAME_MAXLEN) + { + longnamefound = 1; + break; + } + + // the original C++ side assumes there was + // only one channel list (who would have multiple) + // but let's not make that same assertion and check names + // if we encounter any channel list named anything + if (cura->type == EXR_ATTR_CHLIST) + { + const exr_attr_chlist_t* chlist = cura->chlist; + int nc = chlist->num_channels; + + for ( int c = 0; c < nc; ++c ) + { + const exr_attr_chlist_entry_t *ce = chlist->entries + c; + if (ce->name.length > EXR_SHORTNAME_MAXLEN) + { + longnamefound = 1; + break; + } + } + } + } + + if (longnamefound) + break; + } + + if (longnamefound) + *flags |= EXR_LONG_NAMES_FLAG; + } + + if (ctxt->has_nonimage_data) *flags |= EXR_NON_IMAGE_FLAG; + if (ctxt->is_singlepart_tiled) *flags |= EXR_TILED_FLAG; + + return EXR_ERR_SUCCESS; +} + + /**************************************/ exr_result_t @@ -606,12 +667,7 @@ internal_exr_write_header (exr_context_t ctxt) uint32_t flags; uint8_t next_byte; - flags = 2; // EXR_VERSION - if (ctxt->is_multipart) flags |= EXR_MULTI_PART_FLAG; - if (ctxt->max_name_length > EXR_SHORTNAME_MAXLEN) - flags |= EXR_LONG_NAMES_FLAG; - if (ctxt->has_nonimage_data) flags |= EXR_NON_IMAGE_FLAG; - if (ctxt->is_singlepart_tiled) flags |= EXR_TILED_FLAG; + rv = internal_exr_calc_header_version_flags (ctxt, &flags); magic_and_version[0] = 20000630; magic_and_version[1] = flags; From aed82c1484db79595c9e6c9b0a6637517700a74f Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Thu, 18 Apr 2024 01:19:11 +1200 Subject: [PATCH 17/35] Add unknown storage mode for future proofing, fix logic Signed-off-by: Kimball Thurston --- src/lib/OpenEXRCore/chunk.c | 8 ++++---- src/lib/OpenEXRCore/openexr_attr.h | 3 ++- src/lib/OpenEXRCore/parse_header.c | 21 ++++++++++++++++---- src/lib/OpenEXRCore/validation.c | 31 ++++++++++++++++++++++++++---- 4 files changed, 50 insertions(+), 13 deletions(-) diff --git a/src/lib/OpenEXRCore/chunk.c b/src/lib/OpenEXRCore/chunk.c index d326d9be73..e2db0e070e 100644 --- a/src/lib/OpenEXRCore/chunk.c +++ b/src/lib/OpenEXRCore/chunk.c @@ -742,8 +742,8 @@ exr_read_scanline_chunk_info ( if (!cinfo) return ctxt->standard_error (ctxt, EXR_ERR_INVALID_ARGUMENT); - if (part->storage_mode == EXR_STORAGE_TILED || - part->storage_mode == EXR_STORAGE_DEEP_TILED) + if (part->storage_mode != EXR_STORAGE_SCANLINE && + part->storage_mode != EXR_STORAGE_DEEP_SCANLINE) { return ctxt->standard_error (ctxt, EXR_ERR_SCAN_TILE_MIXEDAPI); } @@ -1002,8 +1002,8 @@ exr_read_tile_chunk_info ( if (!cinfo) return ctxt->standard_error (ctxt, EXR_ERR_INVALID_ARGUMENT); - if (part->storage_mode == EXR_STORAGE_SCANLINE || - part->storage_mode == EXR_STORAGE_DEEP_SCANLINE) + if (part->storage_mode != EXR_STORAGE_TILED && + part->storage_mode != EXR_STORAGE_DEEP_TILED) { return ctxt->standard_error (ctxt, EXR_ERR_TILE_SCAN_MIXEDAPI); } diff --git a/src/lib/OpenEXRCore/openexr_attr.h b/src/lib/OpenEXRCore/openexr_attr.h index bcc3c1c74b..407ab6dd7f 100644 --- a/src/lib/OpenEXRCore/openexr_attr.h +++ b/src/lib/OpenEXRCore/openexr_attr.h @@ -72,7 +72,8 @@ typedef enum EXR_STORAGE_TILED, /**< Corresponds to type of \c tiledimage. */ EXR_STORAGE_DEEP_SCANLINE, /**< Corresponds to type of \c deepscanline. */ EXR_STORAGE_DEEP_TILED, /**< Corresponds to type of \c deeptile. */ - EXR_STORAGE_LAST_TYPE /**< Invalid value, provided for range checking. */ + EXR_STORAGE_LAST_TYPE, /**< Invalid value, provided for range checking. */ + EXR_STORAGE_UNKNOWN /**< An unknown type, provided for future proofing. */ } exr_storage_t; /** @brief Enum representing what type of tile information is contained. */ diff --git a/src/lib/OpenEXRCore/parse_header.c b/src/lib/OpenEXRCore/parse_header.c index 1018c61bdf..ebc79e7b51 100644 --- a/src/lib/OpenEXRCore/parse_header.c +++ b/src/lib/OpenEXRCore/parse_header.c @@ -1615,7 +1615,7 @@ check_populate_type ( if (ctxt->has_nonimage_data || ctxt->is_multipart) curpart->storage_mode = EXR_STORAGE_DEEP_TILED; } - else + else if (ctxt->strict_header) { rv = ctxt->print_error ( ctxt, @@ -1624,6 +1624,13 @@ check_populate_type ( outstr); exr_attr_list_remove (ctxt, &(curpart->attributes), curpart->type); curpart->type = NULL; + if (curpart->storage_mode == EXR_STORAGE_LAST_TYPE) + curpart->storage_mode = EXR_STORAGE_UNKNOWN; + } + else + { + if (curpart->storage_mode == EXR_STORAGE_LAST_TYPE) + curpart->storage_mode = EXR_STORAGE_UNKNOWN; } return rv; @@ -1676,8 +1683,13 @@ check_populate_version ( attrsz = (int32_t) one_to_native32 ((uint32_t) attrsz); if (attrsz != 1) - return ctxt->print_error ( - ctxt, EXR_ERR_INVALID_ATTR, "Invalid version %d: expect 1", attrsz); + { + if (ctxt->strict_header) + { + return ctxt->print_error ( + ctxt, EXR_ERR_INVALID_ATTR, "Invalid version %d: expect 1", attrsz); + } + } rv = exr_attr_list_add_static_name ( ctxt, @@ -2144,7 +2156,8 @@ internal_exr_compute_tile_information ( { exr_result_t rv = EXR_ERR_SUCCESS; if (curpart->storage_mode == EXR_STORAGE_SCANLINE || - curpart->storage_mode == EXR_STORAGE_DEEP_SCANLINE) + curpart->storage_mode == EXR_STORAGE_DEEP_SCANLINE || + curpart->storage_mode == EXR_STORAGE_UNKNOWN) return EXR_ERR_SUCCESS; if (rebuild && (!curpart->dataWindow || !curpart->tiles)) diff --git a/src/lib/OpenEXRCore/validation.c b/src/lib/OpenEXRCore/validation.c index 8c08dd39a9..202a204af6 100644 --- a/src/lib/OpenEXRCore/validation.c +++ b/src/lib/OpenEXRCore/validation.c @@ -5,6 +5,7 @@ #include "internal_file.h" +#include "internal_constants.h" #include #include #include @@ -202,15 +203,35 @@ validate_req_attr (exr_context_t f, exr_priv_part_t curpart, int adddefault) EXR_ERR_MISSING_REQ_ATTR, "'name' attribute for multipart file not found"); if (!curpart->type) + { return f->print_error ( f, EXR_ERR_MISSING_REQ_ATTR, "'type' attribute for v2+ file not found"); + } if (f->has_nonimage_data && !curpart->version) - return f->print_error ( - f, - EXR_ERR_MISSING_REQ_ATTR, - "'version' attribute for deep file not found"); + { + /* TODO: C++ goes ahead and just assumes there's a version of 1... */ + if (adddefault) + { + rv = exr_attr_list_add_static_name ( + f, + &(curpart->attributes), + EXR_REQ_VERSION_STR, + EXR_ATTR_INT, + 0, + NULL, + &(curpart->version)); + curpart->version->i = 1; + } + else + { + return f->print_error ( + f, + EXR_ERR_MISSING_REQ_ATTR, + "'version' attribute for deep file not found"); + } + } if (!curpart->chunkCount) return f->print_error ( f, @@ -471,6 +492,8 @@ validate_part_type (exr_context_t f, exr_priv_part_t curpart) } } + /* NB: we allow an 'unknown' storage type of EXR_STORAGE_UNKNOWN + * for future proofing */ if (curpart->storage_mode == EXR_STORAGE_LAST_TYPE) { return f->print_error ( From 031978a255df25ff25ca32c671aeac14f2785de3 Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Sat, 20 Apr 2024 13:40:00 +1200 Subject: [PATCH 18/35] allow querying the chunk table offset while in write mode Signed-off-by: Kimball Thurston --- src/lib/OpenEXRCore/chunk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/OpenEXRCore/chunk.c b/src/lib/OpenEXRCore/chunk.c index e2db0e070e..2abbf71641 100644 --- a/src/lib/OpenEXRCore/chunk.c +++ b/src/lib/OpenEXRCore/chunk.c @@ -544,7 +544,7 @@ exr_result_t exr_get_chunk_table_offset ( exr_const_context_t ctxt, int part_index, uint64_t* chunk_offset_out) { - EXR_READONLY_AND_DEFINE_PART (part_index); + EXR_LOCK_WRITE_AND_DEFINE_PART (part_index); if (!chunk_offset_out) return ctxt->standard_error (ctxt, EXR_ERR_INVALID_ARGUMENT); From 94bf6ca43c01e0c05e4d0e684530a18f7c3d3be5 Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Sat, 20 Apr 2024 13:41:01 +1200 Subject: [PATCH 19/35] Add tests for new functions added Signed-off-by: Kimball Thurston --- src/test/OpenEXRCoreTest/read.cpp | 27 +++++++++++++++++++++++++++ src/test/OpenEXRCoreTest/write.cpp | 27 +++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/src/test/OpenEXRCoreTest/read.cpp b/src/test/OpenEXRCoreTest/read.cpp index 656ad234ce..f1b61ca01f 100644 --- a/src/test/OpenEXRCoreTest/read.cpp +++ b/src/test/OpenEXRCoreTest/read.cpp @@ -124,9 +124,36 @@ testReadMeta (const std::string& tempdir) exr_context_initializer_t cinit = EXR_DEFAULT_CONTEXT_INITIALIZER; cinit.error_handler_fn = &err_cb; exr_attribute_t* newattr; + uint32_t verflags; + uint64_t cto; EXRCORE_TEST_RVAL (exr_test_file_header (fn.c_str (), &cinit)); EXRCORE_TEST_RVAL (exr_start_read (&f, fn.c_str (), &cinit)); + EXRCORE_TEST_RVAL_FAIL ( + EXR_ERR_MISSING_CONTEXT_ARG, + exr_get_file_version_and_flags (NULL, NULL)); + EXRCORE_TEST_RVAL_FAIL ( + EXR_ERR_INVALID_ARGUMENT, + exr_get_file_version_and_flags (f, NULL)); + EXRCORE_TEST_RVAL ( + exr_get_file_version_and_flags (f, &verflags)); + EXRCORE_TEST (verflags == 2); + + EXRCORE_TEST_RVAL_FAIL ( + EXR_ERR_MISSING_CONTEXT_ARG, + exr_get_chunk_table_offset (NULL, 0, NULL)); + EXRCORE_TEST_RVAL_FAIL ( + EXR_ERR_ARGUMENT_OUT_OF_RANGE, + exr_get_chunk_table_offset (f, -1, NULL)); + EXRCORE_TEST_RVAL_FAIL ( + EXR_ERR_ARGUMENT_OUT_OF_RANGE, + exr_get_chunk_table_offset (f, 2, NULL)); + EXRCORE_TEST_RVAL_FAIL ( + EXR_ERR_INVALID_ARGUMENT, + exr_get_chunk_table_offset (f, 0, NULL)); + EXRCORE_TEST_RVAL ( + exr_get_chunk_table_offset (f, 0, &cto)); + EXRCORE_TEST (cto == 331); EXRCORE_TEST_RVAL_FAIL ( EXR_ERR_NOT_OPEN_WRITE, diff --git a/src/test/OpenEXRCoreTest/write.cpp b/src/test/OpenEXRCoreTest/write.cpp index 98bbefa1a3..1b616e7025 100644 --- a/src/test/OpenEXRCoreTest/write.cpp +++ b/src/test/OpenEXRCoreTest/write.cpp @@ -149,6 +149,11 @@ testStartWriteDeepScan (const std::string& tempdir) EXRCORE_TEST_RVAL (exr_get_storage (outf, partidx, &storage)); EXRCORE_TEST (storage == EXR_STORAGE_DEEP_SCANLINE); + uint32_t verflags; + EXRCORE_TEST_RVAL ( + exr_get_file_version_and_flags (outf, &verflags)); + EXRCORE_TEST (verflags == (2 | 0x00000800)); + EXRCORE_TEST_RVAL (exr_finish (&outf)); remove (outfn.c_str ()); } @@ -248,6 +253,11 @@ testStartWriteDeepTile (const std::string& tempdir) EXRCORE_TEST_RVAL (exr_get_storage (outf, partidx, &storage)); EXRCORE_TEST (storage == EXR_STORAGE_DEEP_TILED); + uint32_t verflags; + EXRCORE_TEST_RVAL ( + exr_get_file_version_and_flags (outf, &verflags)); + EXRCORE_TEST (verflags == (2 | 0x00000800)); + EXRCORE_TEST_RVAL (exr_finish (&outf)); remove (outfn.c_str ()); } @@ -258,6 +268,7 @@ testWriteBaseHeader (const std::string& tempdir) exr_context_t outf; std::string outfn = tempdir + "testattr.exr"; int partidx; + uint32_t verflags; exr_context_initializer_t cinit = EXR_DEFAULT_CONTEXT_INITIALIZER; cinit.error_handler_fn = &err_cb; @@ -464,6 +475,14 @@ testWriteBaseHeader (const std::string& tempdir) 1)); EXRCORE_TEST_RVAL (exr_write_header (outf)); + EXRCORE_TEST_RVAL ( + exr_get_file_version_and_flags (outf, &verflags)); + EXRCORE_TEST (verflags == 2); + + uint64_t cto; + EXRCORE_TEST_RVAL ( + exr_get_chunk_table_offset (outf, 0, &cto)); + EXRCORE_TEST (cto == 364); EXRCORE_TEST_RVAL (exr_finish (&outf)); remove (outfn.c_str ()); @@ -533,6 +552,9 @@ testWriteBaseHeader (const std::string& tempdir) EXRCORE_TEST (txsize == 32 && tysize == 32); EXRCORE_TEST_RVAL (exr_write_header (outf)); + EXRCORE_TEST_RVAL ( + exr_get_file_version_and_flags (outf, &verflags)); + EXRCORE_TEST (verflags == (2 | 0x00000200)); EXRCORE_TEST_RVAL (exr_finish (&outf)); remove (outfn.c_str ()); @@ -1366,6 +1388,11 @@ testWriteMultiPart (const std::string& tempdir) EXRCORE_TEST_RVAL (exr_get_storage (outf, 1, &storage)); EXRCORE_TEST (storage == EXR_STORAGE_TILED); + uint32_t verflags; + EXRCORE_TEST_RVAL ( + exr_get_file_version_and_flags (outf, &verflags)); + EXRCORE_TEST (verflags == (2 | 0x00001000)); + EXRCORE_TEST_RVAL (exr_finish (&outf)); remove (outfn.c_str ()); } From cfcf99e1a8896a88bf626074ddf09a1c29f2bfbb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 Apr 2024 09:25:18 -0700 Subject: [PATCH 20/35] Bump actions/download-artifact from 4.1.4 to 4.1.5 (#1722) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.4 to 4.1.5. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/c850b930e6ba138125429b7e5c93fc707a7f8427...8caf195ad4b1dee92908e23f56eeb0696f1dd42d) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/python-wheels-publish-test.yml | 6 +++--- .github/workflows/python-wheels-publish.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-wheels-publish-test.yml b/.github/workflows/python-wheels-publish-test.yml index 4148c9c1a2..6c4577092f 100644 --- a/.github/workflows/python-wheels-publish-test.yml +++ b/.github/workflows/python-wheels-publish-test.yml @@ -84,17 +84,17 @@ jobs: steps: - name: Download Linux artifacts - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 + uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5 with: name: wheels-ubuntu-latest path: dist - name: Download macOS artifacts - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 + uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5 with: name: wheels-macos-latest path: dist - name: Download Windows artifacts - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 + uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5 with: name: wheels-windows-latest path: dist diff --git a/.github/workflows/python-wheels-publish.yml b/.github/workflows/python-wheels-publish.yml index 9d204b1fe0..11ebd63b67 100644 --- a/.github/workflows/python-wheels-publish.yml +++ b/.github/workflows/python-wheels-publish.yml @@ -78,17 +78,17 @@ jobs: steps: - name: Download Linux artifacts - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 + uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5 with: name: wheels-ubuntu-latest path: dist - name: Download macOS artifacts - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 + uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5 with: name: wheels-macos-latest path: dist - name: Download Windows artifacts - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 + uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5 with: name: wheels-windows-latest path: dist From 1a28088c89314cdb4bcdf97f8cc4d783132c6d17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 Apr 2024 09:26:42 -0700 Subject: [PATCH 21/35] Bump actions/upload-artifact from 4.3.1 to 4.3.2 (#1723) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.1 to 4.3.2. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/5d5d22a31266ced268874388b861e4b58bb5c2f3...1746f4ab65b179e0ea60a494b83293b640dd5bba) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ossfuzz_workflow.yml | 2 +- .github/workflows/python-wheels-publish-test.yml | 2 +- .github/workflows/python-wheels-publish.yml | 2 +- .github/workflows/python-wheels.yml | 2 +- .github/workflows/scorecard.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ossfuzz_workflow.yml b/.github/workflows/ossfuzz_workflow.yml index ac383c1f07..0c5dc40b13 100644 --- a/.github/workflows/ossfuzz_workflow.yml +++ b/.github/workflows/ossfuzz_workflow.yml @@ -48,7 +48,7 @@ jobs: dry-run: false language: c++ - name: Upload Crash - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 if: failure() && steps.build.outcome == 'success' with: name: artifacts diff --git a/.github/workflows/python-wheels-publish-test.yml b/.github/workflows/python-wheels-publish-test.yml index 6c4577092f..d06cdd7afd 100644 --- a/.github/workflows/python-wheels-publish-test.yml +++ b/.github/workflows/python-wheels-publish-test.yml @@ -62,7 +62,7 @@ jobs: CIBW_ENVIRONMENT: OPENEXR_RELEASE_CANDIDATE_TAG="${{ github.ref_name }}" - name: Upload artifact - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 with: name: wheels-${{ matrix.os }} path: | diff --git a/.github/workflows/python-wheels-publish.yml b/.github/workflows/python-wheels-publish.yml index 11ebd63b67..404a7cd89a 100644 --- a/.github/workflows/python-wheels-publish.yml +++ b/.github/workflows/python-wheels-publish.yml @@ -56,7 +56,7 @@ jobs: CIBW_TEST_SKIP: "*arm64" - name: Upload artifact - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 with: name: wheels-${{ matrix.os }} path: | diff --git a/.github/workflows/python-wheels.yml b/.github/workflows/python-wheels.yml index 36f58f509a..1dce68d464 100644 --- a/.github/workflows/python-wheels.yml +++ b/.github/workflows/python-wheels.yml @@ -65,7 +65,7 @@ jobs: CIBW_TEST_SKIP: "*-macosx*arm64" - name: Upload artifact - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 with: name: wheels-${{ matrix.os }} path: | diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index f12ff87994..46a8e18a31 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -43,7 +43,7 @@ jobs: # Upload the results as artifacts (optional) - name: "Upload artifact" - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 with: name: SARIF file path: results.sarif From 421f1b4d2a9182f8fc035927a7a0a213b3c1825f Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Sat, 20 Apr 2024 17:47:25 +1200 Subject: [PATCH 22/35] Fix discrepancy from C++ in DWAA compress C++ differentiated scanlines vs tiles in the DWAA compression type Signed-off-by: Kimball Thurston --- src/lib/OpenEXRCore/internal_dwa.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib/OpenEXRCore/internal_dwa.c b/src/lib/OpenEXRCore/internal_dwa.c index 3a42faae17..c6d2a579a0 100644 --- a/src/lib/OpenEXRCore/internal_dwa.c +++ b/src/lib/OpenEXRCore/internal_dwa.c @@ -135,7 +135,12 @@ internal_exr_apply_dwaa (exr_encode_pipeline_t* encode) internal_exr_huf_compress_spare_bytes ()); if (rv == EXR_ERR_SUCCESS) { - rv = DwaCompressor_construct (&dwaa, DEFLATE, encode, NULL); + exr_storage_t st = (exr_storage_t)encode->chunk.type; + AcCompression accomp = STATIC_HUFFMAN; + /* C++ had this discrepancy between encoders for tiled vs scanline */ + if (st == EXR_STORAGE_TILED || st == EXR_STORAGE_DEEP_TILED) + accomp = DEFLATE; + rv = DwaCompressor_construct (&dwaa, accomp, encode, NULL); if (rv == EXR_ERR_SUCCESS) rv = DwaCompressor_compress (&dwaa); DwaCompressor_destroy (&dwaa); @@ -188,6 +193,10 @@ internal_exr_undo_dwaa ( internal_exr_huf_decompress_spare_bytes ()); if (rv == EXR_ERR_SUCCESS) { + /* + * decompression doesn't pay attention to the acCompression flag + * but if it ever needs to, match above discrepancy scanline vs tile + */ rv = DwaCompressor_construct (&dwaa, STATIC_HUFFMAN, NULL, decode); if (rv == EXR_ERR_SUCCESS) rv = DwaCompressor_uncompress ( From 694606da25571c04bf0cace3e565fbc7ec6aa277 Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Sat, 20 Apr 2024 17:48:31 +1200 Subject: [PATCH 23/35] Fix mis-match in compression levels and tile description This means all files saved c++ vs C match precisely, re-enable that failure mode (had been behind an env variable) Signed-off-by: Kimball Thurston --- src/test/OpenEXRCoreTest/compression.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/test/OpenEXRCoreTest/compression.cpp b/src/test/OpenEXRCoreTest/compression.cpp index 69bb37b3da..d9bca0b8c5 100644 --- a/src/test/OpenEXRCoreTest/compression.cpp +++ b/src/test/OpenEXRCoreTest/compression.cpp @@ -1066,8 +1066,8 @@ saveCPP ( (Box2i (V2i (dwx, dwy), V2i (dwx + fw - 1, dwy + fh - 1)))); hdr.compression () = (IMF::Compression) ((int) comp); - hdr.zipCompressionLevel () = 3; - EXRCORE_TEST (((const Header&) hdr).zipCompressionLevel () == 3); + hdr.zipCompressionLevel () = 4; + EXRCORE_TEST (((const Header&) hdr).zipCompressionLevel () == 4); hdr.channels ().insert ("I", Channel (IMF::UINT, xs, ys)); for (int c = 0; c < 5; ++c) @@ -1315,7 +1315,7 @@ doWriteRead ( if (tiled) { EXRCORE_TEST_RVAL (exr_set_tile_descriptor ( - f, partidx, 32, 32, EXR_TILE_ONE_LEVEL, EXR_TILE_ROUND_UP)); + f, partidx, 32, 32, EXR_TILE_ONE_LEVEL, EXR_TILE_ROUND_DOWN)); } EXRCORE_TEST_RVAL (exr_add_channel ( @@ -1360,12 +1360,10 @@ doWriteRead ( } #ifdef __linux - if (getenv ("ENABLE_EXACT_FILE_COMPARE") && - 0 != compare_files (filename.c_str (), cppfilename.c_str ())) + if (0 != compare_files (filename.c_str (), cppfilename.c_str ())) { EXRCORE_TEST_FAIL (compare_files); } - else { compare_files (filename.c_str (), cppfilename.c_str ()); } #endif pixels restore = p; pixels cpprestore = p; From 1b2b78858dad639973706d14044254f9e42759ba Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Wed, 24 Apr 2024 17:33:40 +0200 Subject: [PATCH 24/35] Silence warning C4201: nonstandard extension used: nameless struct/union. Signed-off-by: Dirk Lemstra --- src/lib/OpenEXRCore/openexr_attr.h | 54 ++++-------------------------- src/lib/OpenEXRCore/parse_header.c | 12 +++---- 2 files changed, 12 insertions(+), 54 deletions(-) diff --git a/src/lib/OpenEXRCore/openexr_attr.h b/src/lib/OpenEXRCore/openexr_attr.h index 407ab6dd7f..a1aede0c7c 100644 --- a/src/lib/OpenEXRCore/openexr_attr.h +++ b/src/lib/OpenEXRCore/openexr_attr.h @@ -186,79 +186,37 @@ typedef struct /** @brief Struct to hold a 2-element integer vector. */ typedef struct { - union - { - struct - { - int32_t x, y; - }; - int32_t arr[2]; - }; + int32_t x, y; } exr_attr_v2i_t; /** @brief Struct to hold a 2-element 32-bit float vector. */ typedef struct { - union - { - struct - { - float x, y; - }; - float arr[2]; - }; + float x, y; } exr_attr_v2f_t; /** @brief Struct to hold a 2-element 64-bit float vector. */ typedef struct { - union - { - struct - { - double x, y; - }; - double arr[2]; - }; + double x, y; } exr_attr_v2d_t; /** @brief Struct to hold a 3-element integer vector. */ typedef struct { - union - { - struct - { - int32_t x, y, z; - }; - int32_t arr[3]; - }; + int32_t x, y, z; } exr_attr_v3i_t; /** @brief Struct to hold a 3-element 32-bit float vector. */ typedef struct { - union - { - struct - { - float x, y, z; - }; - float arr[3]; - }; + float x, y, z; } exr_attr_v3f_t; /** @brief Struct to hold a 3-element 64-bit float vector. */ typedef struct { - union - { - struct - { - double x, y, z; - }; - double arr[3]; - }; + double x, y, z; } exr_attr_v3d_t; /** @brief Struct to hold an integer box/region definition. */ diff --git a/src/lib/OpenEXRCore/parse_header.c b/src/lib/OpenEXRCore/parse_header.c index ebc79e7b51..a9851a9f21 100644 --- a/src/lib/OpenEXRCore/parse_header.c +++ b/src/lib/OpenEXRCore/parse_header.c @@ -2046,27 +2046,27 @@ pull_attr ( break; case EXR_ATTR_V2I: rv = extract_attr_32bit ( - ctxt, scratch, nattr->v2i->arr, name, type, attrsz, 2); + ctxt, scratch, nattr->v2i, name, type, attrsz, 2); break; case EXR_ATTR_V2F: rv = extract_attr_32bit ( - ctxt, scratch, nattr->v2f->arr, name, type, attrsz, 2); + ctxt, scratch, nattr->v2f, name, type, attrsz, 2); break; case EXR_ATTR_V2D: rv = extract_attr_64bit ( - ctxt, scratch, nattr->v2d->arr, name, type, attrsz, 2); + ctxt, scratch, nattr->v2d, name, type, attrsz, 2); break; case EXR_ATTR_V3I: rv = extract_attr_32bit ( - ctxt, scratch, nattr->v3i->arr, name, type, attrsz, 3); + ctxt, scratch, nattr->v3i, name, type, attrsz, 3); break; case EXR_ATTR_V3F: rv = extract_attr_32bit ( - ctxt, scratch, nattr->v3f->arr, name, type, attrsz, 3); + ctxt, scratch, nattr->v3f, name, type, attrsz, 3); break; case EXR_ATTR_V3D: rv = extract_attr_64bit ( - ctxt, scratch, nattr->v3d->arr, name, type, attrsz, 3); + ctxt, scratch, nattr->v3d, name, type, attrsz, 3); break; case EXR_ATTR_DEEP_IMAGE_STATE: rv = extract_attr_uint8 ( From 5f9bee0d7706cd26c50be2adbebae9910d240ae9 Mon Sep 17 00:00:00 2001 From: Matthias Moulin Date: Tue, 7 May 2024 17:20:30 +0200 Subject: [PATCH 25/35] Removed unused sliceOptimizationData::type (#1742) Removed unused `sliceOptimizationData::type` (which is always equal to `OPENEXR_IMF_INTERNAL_NAMESPACE::HALF`). Signed-off-by: Matthias Moulin --- src/lib/OpenEXR/ImfScanLineInputFile.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/OpenEXR/ImfScanLineInputFile.cpp b/src/lib/OpenEXR/ImfScanLineInputFile.cpp index 396d7c0e8e..99a4bd1b58 100644 --- a/src/lib/OpenEXR/ImfScanLineInputFile.cpp +++ b/src/lib/OpenEXR/ImfScanLineInputFile.cpp @@ -160,7 +160,6 @@ struct sliceOptimizationData half fillValue; ///< if filling, the value to use size_t offset; ///< position this channel will be in the read buffer, accounting for previous channels, as well as their type - PixelType type; ///< type of channel size_t xStride; ///< x-stride of channel in buffer (must be set to cause channels to interleave) size_t From 7de2958171c7659c6dd410f20af14588a4c1c336 Mon Sep 17 00:00:00 2001 From: Vertexwahn Date: Tue, 7 May 2024 17:21:22 +0200 Subject: [PATCH 26/35] Bazel support: Add test output to CI Bazel tests (#1744) Signed-off-by: Vertexwahn --- .bazelversion | 2 +- .github/workflows/bazel_build.yml | 8 ++++---- MODULE.bazel | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.bazelversion b/.bazelversion index a8907c025d..21c8c7b46b 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -7.0.2 +7.1.1 diff --git a/.github/workflows/bazel_build.yml b/.github/workflows/bazel_build.yml index 9346a402a7..9b3baeb7c5 100644 --- a/.github/workflows/bazel_build.yml +++ b/.github/workflows/bazel_build.yml @@ -50,7 +50,7 @@ jobs: - name: Build run: | bazelisk build //... - bazelisk test //... + bazelisk test --test_output=errors //... build_and_test_windows: name: Windows Server 2022 build @@ -68,7 +68,7 @@ jobs: - name: Build run: | bazelisk build //... - bazelisk test //... + bazelisk test --test_output=errors //... build_and_test_macos: name: macOS 13 Bazel build @@ -86,7 +86,7 @@ jobs: - name: Build run: | bazelisk build //... - bazelisk test //... + bazelisk test --test_output=errors //... build_and_test_macos_M1: name: macOS 14 Bazel build @@ -104,4 +104,4 @@ jobs: - name: Build run: | bazelisk build //... - bazelisk test //... + bazelisk test --test_output=errors //... diff --git a/MODULE.bazel b/MODULE.bazel index 8742e50fd6..2cf73ce469 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -6,7 +6,7 @@ module( compatibility_level = 1, ) -bazel_dep(name = "bazel_skylib", version = "1.5.0") +bazel_dep(name = "bazel_skylib", version = "1.6.1") bazel_dep(name = "imath", version = "3.1.11") -bazel_dep(name = "libdeflate", version = "1.19") -bazel_dep(name = "platforms", version = "0.0.8") +bazel_dep(name = "libdeflate", version = "1.20.bcr.1") +bazel_dep(name = "platforms", version = "0.0.10") From da3f4494cd30df2589e5ee0b3e9e099b8216eb9a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 11:22:34 -0400 Subject: [PATCH 27/35] Bump actions/download-artifact from 4.1.5 to 4.1.7 (#1736) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.5 to 4.1.7. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/8caf195ad4b1dee92908e23f56eeb0696f1dd42d...65a9edc5881444af0b9093a5e628f2fe47ea3b2e) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/python-wheels-publish-test.yml | 6 +++--- .github/workflows/python-wheels-publish.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-wheels-publish-test.yml b/.github/workflows/python-wheels-publish-test.yml index d06cdd7afd..0130e81c80 100644 --- a/.github/workflows/python-wheels-publish-test.yml +++ b/.github/workflows/python-wheels-publish-test.yml @@ -84,17 +84,17 @@ jobs: steps: - name: Download Linux artifacts - uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5 + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: wheels-ubuntu-latest path: dist - name: Download macOS artifacts - uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5 + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: wheels-macos-latest path: dist - name: Download Windows artifacts - uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5 + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: wheels-windows-latest path: dist diff --git a/.github/workflows/python-wheels-publish.yml b/.github/workflows/python-wheels-publish.yml index 404a7cd89a..dbcd247e74 100644 --- a/.github/workflows/python-wheels-publish.yml +++ b/.github/workflows/python-wheels-publish.yml @@ -78,17 +78,17 @@ jobs: steps: - name: Download Linux artifacts - uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5 + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: wheels-ubuntu-latest path: dist - name: Download macOS artifacts - uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5 + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: wheels-macos-latest path: dist - name: Download Windows artifacts - uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5 + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: wheels-windows-latest path: dist From e89466bf0a7de39fd8bef57fe7280b7e9e1c1446 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 11:23:18 -0400 Subject: [PATCH 28/35] Bump actions/upload-artifact from 4.3.2 to 4.3.3 (#1733) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.2 to 4.3.3. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/1746f4ab65b179e0ea60a494b83293b640dd5bba...65462800fd760344b1a7b4382951275a0abb4808) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ossfuzz_workflow.yml | 2 +- .github/workflows/python-wheels-publish-test.yml | 2 +- .github/workflows/python-wheels-publish.yml | 2 +- .github/workflows/python-wheels.yml | 2 +- .github/workflows/scorecard.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ossfuzz_workflow.yml b/.github/workflows/ossfuzz_workflow.yml index 0c5dc40b13..390cfe43f9 100644 --- a/.github/workflows/ossfuzz_workflow.yml +++ b/.github/workflows/ossfuzz_workflow.yml @@ -48,7 +48,7 @@ jobs: dry-run: false language: c++ - name: Upload Crash - uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 if: failure() && steps.build.outcome == 'success' with: name: artifacts diff --git a/.github/workflows/python-wheels-publish-test.yml b/.github/workflows/python-wheels-publish-test.yml index 0130e81c80..3f2d0896a7 100644 --- a/.github/workflows/python-wheels-publish-test.yml +++ b/.github/workflows/python-wheels-publish-test.yml @@ -62,7 +62,7 @@ jobs: CIBW_ENVIRONMENT: OPENEXR_RELEASE_CANDIDATE_TAG="${{ github.ref_name }}" - name: Upload artifact - uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: wheels-${{ matrix.os }} path: | diff --git a/.github/workflows/python-wheels-publish.yml b/.github/workflows/python-wheels-publish.yml index dbcd247e74..4b90c7e084 100644 --- a/.github/workflows/python-wheels-publish.yml +++ b/.github/workflows/python-wheels-publish.yml @@ -56,7 +56,7 @@ jobs: CIBW_TEST_SKIP: "*arm64" - name: Upload artifact - uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: wheels-${{ matrix.os }} path: | diff --git a/.github/workflows/python-wheels.yml b/.github/workflows/python-wheels.yml index 1dce68d464..1f7336f357 100644 --- a/.github/workflows/python-wheels.yml +++ b/.github/workflows/python-wheels.yml @@ -65,7 +65,7 @@ jobs: CIBW_TEST_SKIP: "*-macosx*arm64" - name: Upload artifact - uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: wheels-${{ matrix.os }} path: | diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 46a8e18a31..c787b9f451 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -43,7 +43,7 @@ jobs: # Upload the results as artifacts (optional) - name: "Upload artifact" - uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: SARIF file path: results.sarif From 810e4567a9a1f6a58db344c163976925be2e9404 Mon Sep 17 00:00:00 2001 From: Christina Tempelaar-Lietz Date: Mon, 6 May 2024 10:51:36 -0700 Subject: [PATCH 29/35] Update CI workflow to 2024 images. Signed-off-by: Christina Tempelaar-Lietz --- .github/workflows/ci_workflow.yml | 80 ++++++++++++++++++------------- 1 file changed, 47 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index 92e4db3baf..dc6b67f3bf 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -71,9 +71,8 @@ jobs: matrix: build: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] include: - # ------------------------------------------------------------------- - # VFX CY2023 - GCC + # VFX CY2024 - GCC # ------------------------------------------------------------------- # Shared, Release - build: 1 @@ -85,7 +84,7 @@ jobs: compiler-desc: gcc11.2.1 label: threads-enabled: 'ON' - vfx-cy: 2023 + vfx-cy: 2024 exclude-tests: # Shared, Release, Threads OFF @@ -98,7 +97,7 @@ jobs: compiler-desc: gcc11.2.1 label: threads-enabled: 'OFF' - vfx-cy: 2023 + vfx-cy: 2024 exclude-tests: # Shared, Debug @@ -111,7 +110,7 @@ jobs: compiler-desc: gcc11.2.1 label: threads-enabled: 'ON' - vfx-cy: 2023 + vfx-cy: 2024 exclude-tests: # Static, Release @@ -124,7 +123,7 @@ jobs: compiler-desc: gcc11.2.1 label: threads-enabled: 'ON' - vfx-cy: 2023 + vfx-cy: 2024 exclude-tests: # Shared, Release, C++14 @@ -137,11 +136,11 @@ jobs: compiler-desc: gcc11.2.1 label: threads-enabled: 'ON' - vfx-cy: 2023 + vfx-cy: 2024 exclude-tests: # ------------------------------------------------------------------- - # VFX CY2023 - Clang 15.0 + # VFX CY2024 - Clang 15.0 # ------------------------------------------------------------------- # Release - build: 6 @@ -153,11 +152,11 @@ jobs: compiler-desc: clang15.0 label: threads-enabled: 'ON' - vfx-cy: 2023 + vfx-cy: 2024 exclude-tests: # ------------------------------------------------------------------- - # VFX CY2023 - Clang 14.0 + # VFX CY2024 - Clang 14.0 # ------------------------------------------------------------------- # Release - build: 7 @@ -169,11 +168,11 @@ jobs: compiler-desc: clang14.0 label: threads-enabled: 'ON' - vfx-cy: 2023 + vfx-cy: 2024 exclude-tests: # ------------------------------------------------------------------- - # VFX CY2022 - GCC, Release + # VFX CY2023 - GCC # ------------------------------------------------------------------- # Shared, Release - build: 8 @@ -182,14 +181,14 @@ jobs: cxx-standard: 17 cxx-compiler: g++ cc-compiler: gcc - compiler-desc: gcc9.3.1 + compiler-desc: gcc11.2.1 label: threads-enabled: 'ON' - vfx-cy: 2022 + vfx-cy: 2023 exclude-tests: # ------------------------------------------------------------------- - # VFX CY2021 - GCC, Release + # VFX CY2022 - GCC, Release # ------------------------------------------------------------------- # Shared, Release - build: 9 @@ -201,23 +200,23 @@ jobs: compiler-desc: gcc9.3.1 label: threads-enabled: 'ON' - vfx-cy: 2021 + vfx-cy: 2022 exclude-tests: # ------------------------------------------------------------------- - # VFX CY2020 - GCC, Release + # VFX CY2021 - GCC, Release # ------------------------------------------------------------------- # Shared, Release - build: 10 build-type: Release build-shared: 'ON' - cxx-standard: 14 + cxx-standard: 17 cxx-compiler: g++ cc-compiler: gcc - compiler-desc: gcc6.3.1 + compiler-desc: gcc9.3.1 label: threads-enabled: 'ON' - vfx-cy: 2020 + vfx-cy: 2021 exclude-tests: env: @@ -294,10 +293,10 @@ jobs: runs-on: macos-${{ matrix.osver }} strategy: matrix: - build: [1, 2, 3, 4, 5] + build: [1, 2, 3, 4, 5, 6] include: # ------------------------------------------------------------------- - # VFX CY2023 - C++17 - MacOS 11.0 + # MacOS 14 # ------------------------------------------------------------------- # Shared, Release - build: 1 @@ -306,9 +305,9 @@ jobs: threads-enabled: 'ON' compiler-desc: AppleClang11.0 cxx-standard: 17 - osver: 11.0 + osver: 14 exclude-tests: - vfx-cy: 23 + vfx-cy: 24 # Shared, Release, Threads OFF - build: 2 @@ -317,9 +316,9 @@ jobs: threads-enabled: 'OFF' compiler-desc: AppleClang11.0 cxx-standard: 17 - osver: 11.0 + osver: 14 exclude-tests: - vfx-cy: 23 + vfx-cy: 24 # Static, Release - build: 3 @@ -328,9 +327,9 @@ jobs: threads-enabled: 'ON' compiler-desc: AppleClang11.0 cxx-standard: 17 - osver: 11.0 + osver: 14 exclude-tests: - vfx-cy: 23 + vfx-cy: 24 # Shared, Debug - build: 4 @@ -339,12 +338,12 @@ jobs: threads-enabled: 'ON' compiler-desc: AppleClang11.0 cxx-standard: 17 - osver: 11.0 + osver: 14 exclude-tests: - vfx-cy: 23 + vfx-cy: 24 # ------------------------------------------------------------------- - # VFX CY2023 - C++17 - MacOS 12 + # MacOS 13 # ------------------------------------------------------------------- # Shared, Release - build: 5 @@ -353,10 +352,25 @@ jobs: threads-enabled: 'ON' compiler-desc: AppleClang11.0 cxx-standard: 17 - osver: 12.0 + osver: 13 exclude-tests: vfx-cy: 23 + # ------------------------------------------------------------------- + # MacOS 12 + # ------------------------------------------------------------------- + # Shared, Release + - build: 6 + build-type: Release + build-shared: 'ON' + threads-enabled: 'ON' + compiler-desc: AppleClang10.5 + cxx-standard: 17 + osver: 12 + exclude-tests: + vfx-cy: 23 + + steps: - name: Checkout uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 @@ -460,7 +474,7 @@ jobs: exclude-tests: '' osver: 2022 - # ------------------------------------------------------------------- + # ------------------------------------------------------------------- # VFX CY2022 - C++17 - Windows 2019 runner - MSVC 2019 (16.11) # ------------------------------------------------------------------- # Shared, Release From 37594c210348897827c09800f4381110621dca16 Mon Sep 17 00:00:00 2001 From: Cary Phillips Date: Mon, 13 May 2024 12:39:07 -0400 Subject: [PATCH 30/35] Install website requirements in venv (#1749) Apparently, macOS doesn't like to pip install into the system-wide location, it prefers a venv. Signed-off-by: Cary Phillips --- .github/workflows/website.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index d29adcc630..c86285ba81 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -25,14 +25,14 @@ on: - RB-* paths: - 'website/**' - - '.github/workflows/website_workflow.yml' + - '.github/workflows/website.yml' pull_request: branches-ignore: - RB-* paths: - 'website/**' - - '.github/workflows/website_workflow.yml' + - '.github/workflows/website.yml' permissions: contents: read @@ -61,12 +61,17 @@ jobs: run: ./website/scripts/install_doxygen.sh ${DOXYGEN_VERSION} shell: bash - name: Install sphinx requirements - run: pip3 install -r website/requirements.txt - - name: Configure - run: cmake .. -DBUILD_WEBSITE=ON -DCMAKE_VERBOSE_MAKEFILE=ON + run: | + python3 -m venv _venv + source _venv/*/activate + pip3 install -r ../website/requirements.txt + cmake .. -DBUILD_WEBSITE=ON -DCMAKE_VERBOSE_MAKEFILE=ON working-directory: _build + shell: bash - name: Build - run: cmake --build . --target website --config Release + run: | + cmake --build . --target website --config Release working-directory: _build + shell: bash From ef52af03878350f03258dd8bd0c6036b6c541406 Mon Sep 17 00:00:00 2001 From: Joseph Goldstone Date: Mon, 13 May 2024 13:08:51 -0400 Subject: [PATCH 31/35] 'Stop' to 'tStop' in website desc of standard attributes (#1754) Signed-off-by: Joseph Goldstone --- website/StandardAttributes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/StandardAttributes.rst b/website/StandardAttributes.rst index 7791659d1b..a1adef0626 100644 --- a/website/StandardAttributes.rst +++ b/website/StandardAttributes.rst @@ -991,7 +991,7 @@ These attributes describe the lens settings. All are optional. - Stop + tStop float From 370db2835843ac75f85e1386c05455f26a6ff58c Mon Sep 17 00:00:00 2001 From: Cary Phillips Date: Mon, 13 May 2024 10:09:52 -0700 Subject: [PATCH 32/35] Fix setting of part name via "name" attribute (#1748) Calling `exr_attr_set_string()` on the "name" attribute sets the part name. But this was inadvertently setting the part name to the string "name", not to the actual value of the attribute. Signed-off-by: Cary Phillips --- src/lib/OpenEXRCore/part_attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/OpenEXRCore/part_attr.c b/src/lib/OpenEXRCore/part_attr.c index f65420f2d9..86bb391e7f 100644 --- a/src/lib/OpenEXRCore/part_attr.c +++ b/src/lib/OpenEXRCore/part_attr.c @@ -1859,7 +1859,7 @@ exr_attr_set_string ( EXR_LOCK_AND_DEFINE_PART (part_index); if (name && !strcmp (name, EXR_REQ_NAME_STR)) - return EXR_UNLOCK_AND_RETURN (exr_set_name (ctxt, part_index, name)); + return EXR_UNLOCK_AND_RETURN (exr_set_name (ctxt, part_index, val)); if (name && !strcmp (name, EXR_REQ_TYPE_STR)) return EXR_UNLOCK_AND_RETURN (ctxt->print_error ( From 04b10543ad2e281f71271bc267c88d7f7d1dd347 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 Jun 2024 09:59:57 -0700 Subject: [PATCH 33/35] --- (#1757) updated-dependencies: - dependency-name: pypa/cibuildwheel dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/python-wheels-publish-test.yml | 2 +- .github/workflows/python-wheels-publish.yml | 2 +- .github/workflows/python-wheels.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-wheels-publish-test.yml b/.github/workflows/python-wheels-publish-test.yml index 3f2d0896a7..b88ac866e1 100644 --- a/.github/workflows/python-wheels-publish-test.yml +++ b/.github/workflows/python-wheels-publish-test.yml @@ -48,7 +48,7 @@ jobs: run: pipx run build --sdist . --outdir wheelhouse - name: Build wheel - uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # v2.17.0 + uses: pypa/cibuildwheel@ba8be0d98853f5744f24e7f902c8adef7ae2e7f3 # v2.18.1 with: output-dir: wheelhouse env: diff --git a/.github/workflows/python-wheels-publish.yml b/.github/workflows/python-wheels-publish.yml index 4b90c7e084..5f5e404116 100644 --- a/.github/workflows/python-wheels-publish.yml +++ b/.github/workflows/python-wheels-publish.yml @@ -42,7 +42,7 @@ jobs: run: pipx run build --sdist . --outdir wheelhouse - name: Build wheel - uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # v2.17.0 + uses: pypa/cibuildwheel@ba8be0d98853f5744f24e7f902c8adef7ae2e7f3 # v2.18.1 with: output-dir: wheelhouse env: diff --git a/.github/workflows/python-wheels.yml b/.github/workflows/python-wheels.yml index 1f7336f357..371bb82ee1 100644 --- a/.github/workflows/python-wheels.yml +++ b/.github/workflows/python-wheels.yml @@ -55,7 +55,7 @@ jobs: run: pipx run build --sdist . --outdir wheelhouse - name: Build wheel - uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # v2.17.0 + uses: pypa/cibuildwheel@ba8be0d98853f5744f24e7f902c8adef7ae2e7f3 # v2.18.1 env: CIBW_ARCHS_MACOS: x86_64 arm64 universal2 # Skip python 3.6 since scikit-build-core requires 3.7+ From cef97397c4f475311c76b24bfb9166ff8f984109 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 Jun 2024 10:00:40 -0700 Subject: [PATCH 34/35] Bump ossf/scorecard-action from 2.3.1 to 2.3.3 (#1750) Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.3.1 to 2.3.3. - [Release notes](https://github.com/ossf/scorecard-action/releases) - [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md) - [Commits](https://github.com/ossf/scorecard-action/compare/0864cf19026789058feabb7e87baa5f140aac736...dc50aa9510b46c811795eb24b2f1ba02a914e534) --- updated-dependencies: - dependency-name: ossf/scorecard-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index c787b9f451..86516297d7 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -30,7 +30,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 + uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3 with: results_file: results.sarif results_format: sarif From 8169016e5cf9a6fe84ef55009f38589b3e410f15 Mon Sep 17 00:00:00 2001 From: Jamil Halabi Date: Mon, 3 Jun 2024 05:17:42 +1200 Subject: [PATCH 35/35] Fix duplicate `uninstall` targets (#1763) Signed-off-by: Jamil Halabi --- CMakeLists.txt | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a773486bb..2181409b80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,34 +49,16 @@ set(OPENEXR_LIB_VERSION "${OPENEXR_LIB_SOVERSION}.${OPENEXR_VERSION}") # e.g. "3 option(OPENEXR_INSTALL "Install OpenEXR libraries" ON) option(OPENEXR_INSTALL_TOOLS "Install OpenEXR tools" ON) -# uninstall target -if(NOT TARGET uninstall) - configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - IMMEDIATE @ONLY) - add_custom_target(uninstall - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) -endif() - -# uninstall target -if(NOT TARGET uninstall) - configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - IMMEDIATE @ONLY) - add_custom_target(uninstall - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) -endif() - -# uninstall target -if(NOT TARGET uninstall) - configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - IMMEDIATE @ONLY) - add_custom_target(uninstall - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) +if(OPENEXR_INSTALL OR OPENEXR_INSTALL_TOOLS) + # uninstall target + if(NOT TARGET uninstall) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) + add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) + endif() endif() include(cmake/LibraryDefine.cmake)