Skip to content

Commit 2ffc82e

Browse files
committed
openexr: update to 3.5.1.
## Version 3.5.1 (September 25, 2026) Patch release that addresses a security vulnerability in ZSTD: - fix heap buffer overflow in ZSTD deep scanline decoding Also, the v3.5.0 release incorrectly identified the `OPENEXR_VERSION_RELEASE_TYPE` and associated `OPENEXR_PACKAGE_NAME` as `-dev`. ### Merged Pull Requests * [2669](AcademySoftwareFoundation/openexr#2669) Fix heap buffer overflow in ZSTD deep scanline decoding (by @cary-ilm/Cary Phillips) ## Version 3.5.0 (September 21, 2026) * Support for lossless compression via [Zstandard](https://github.com/facebook/zstd) - Introduces `ZSTD_COMPRESSION/EXR_COMPRESSION_ZSTD` enum - Features a custom data prep stage that includes ByteShuffle, optional Delta Encoding, and custom data reordering. - Universal lossless support: Works for all image types (including Deep) and supports all OpenEXR pixel/data types. - Deep image gains: Extensive testing with Deep scanlines shows a 20–30% size reduction compared to ZIPS based on image channels (with the best gains on Deep Alpha and Deep ID). - Flat image file size: Achieves comparable compressed sizes to ZIPS. - Flat image speed: Delivers slightly faster compression and decompression speeds compared to ZIPS - Introduces a new dependency on the zstd library; a vendored version (v1.5.7) is provided as a fallback if no installed version is present. * Support for lossy compression based on the High Throughput JPEG 2000 (HTJ2K) standard. - The LJ2K compressor uses the same JPEG 2000 constraints and codec library (OpenJPH) as HTJ2K256, but with lossy coding, producing smaller files at the cost of distortion. - LJ2K should generally offer reduced file sizes and higher throughput compared to DWA. - Currently supports 16-bit HALF, 32-bit FLOAT and 32-bit UINT channels. Lossy coding is currently applied only to RGB channels; other channels are losslessly coded. - The amount of distortion is controlled via a quality level parameter that ranges from 1 to 150. - As with DWA, lossy RGB channels are first transformed to a non-linear preceptual domain before coding. The transformation is log-based when the sample's magnitude is greater than 1, and power-law otherwise. * Improved support for the `colorInteropID` standard attribute as a mechanism to identify the color space of the RGB images: - Added support for `colorInteropID` to command-line tool `exrstdattr`. - Added API functions to validate color metadata in the header to both the C++ and core APIs. - Extended the exrinfo command-line tool to print warnings regarding header color metadata. - Added helper functions to convert between chromaticities and `colorInteropID`. - Added Python bindings for all new functions. - See [An ID for Color Interop](https://github.com/AcademySoftwareFoundation/ColorInterop/blob/main/Recommendations/03_ColorInteropID/ColorInteropID.md) and [Identifying the Color Space of OpenEXR Files](https://github.com/AcademySoftwareFoundation/ColorInterop/blob/main/Recommendations/04_OpenEXRFiles/OpenEXRFiles.md) for details. * Support for a cache for a (de)compression context in the core decode pipeline. - This is a backwards compatible change (i.e. older versions of code compiled against previous headers will still work), with the exception that it does add the requirement that application code actually use the provided initializer when defining `exr_decode_pipeline_t` objects. * For the OpenEXR python module: - Support for the `idManifest` attribute and object - Support for multithreaded read and write - Support for reading/writing from/to `BytesIO` object - Add `setMaxImageSize/setMaxTileSize` functions * Other changes: - `AcesInputFile/AcesOutputFile` and `exr2aces` as marked as deprecated and will be removed in a future release. - Improved handling of many channels - All Imath headers are now included internally via `#include <Imath/...>` - Remove `iex_debugTrap()` function (was not used) - Improved `ChannelList` Iterator API - Fixed a bug that with DWA compression that could silently produce corrupted files. * Also of note: - The vendored version of deflate is 1.26 - The vendored version of OpenJPH is 0.32.0 - The minimum required version of OpenJPH is 0.32.0 ### Security This release addresses the following security vulnerabilities: * OSS-Fuzz [514487287](https://issues.oss-fuzz.com/issues/514487287) Floating-point-exception in `part_exceeds_memory_limits` * OSS-Fuzz [514423826](https://issues.oss-fuzz.com/issues/514423826) Divide-by-zero in `part_exceeds_memory_limits` * OSS-Fuzz [513282267](https://issues.oss-fuzz.com/issues/513282267) Timeout in `openexr_exrgaps_fuzzer` * OSS-Fuzz [512988066](https://issues.oss-fuzz.com/issues/512988066) Out-of-memory in `openexr_exrgaps_fuzzer` ### Merged Pull Requests * [2660](AcademySoftwareFoundation/openexr#2660) Look for version headers in `CMAKE_CURRENT_SOURCE_DIR/external` (by @cary-ilm/Cary Phillips) * [2656](AcademySoftwareFoundation/openexr#2656) Bump zstd from 1.5.7.bcr.1 to 1.5.7.bcr.2 * [2655](AcademySoftwareFoundation/openexr#2655) Bump rules_cc from 0.2.22 to 0.2.25 * [2654](AcademySoftwareFoundation/openexr#2654) Bump required OpenJPH to 0.32.0 (by @cary-ilm/Cary Phillips) * [2650](AcademySoftwareFoundation/openexr#2650) Fix null pointer memcpy in BytesAttribute for zero-length data (by @x4evexnol/babayaga) * [2648](AcademySoftwareFoundation/openexr#2648) Fix DWAB corrupted file (by @vlazar-ilm/Vlad Lazar) * [2640](AcademySoftwareFoundation/openexr#2640) LJ2K: declare the chunk padding in a COM marker segment (by @osamu620/Osamu Watanabe) * [2637](AcademySoftwareFoundation/openexr#2637) LJ2K: Use J2K Type 4 NLT LUT to apply the transfer function (by @palemieux/Pierre-Anthony Lemieux) * [2633](AcademySoftwareFoundation/openexr#2633) LJ2K: pad lossy chunks so that wavelet folds stay on low-pass positions (by @osamu620/Osamu Watanabe) * [2627](AcademySoftwareFoundation/openexr#2627) Reconsitute compression ctxt cache (by @kdt3rd/Kimball Thurston) * [2626](AcademySoftwareFoundation/openexr#2626) Misc warning cleanup (by @kdt3rd/Kimball Thurston) * [2625](AcademySoftwareFoundation/openexr#2625) Cleanup compression information routines (by @kdt3rd/Kimball Thurston) * [2623](AcademySoftwareFoundation/openexr#2623) Zstd compression support (by @vlazar-ilm/Vlad Lazar) * [2620](AcademySoftwareFoundation/openexr#2620) LJ2K: handle non-finite and out-of-bound samples gracefully (by @palemieux/Pierre-Anthony Lemieux) * [2618](AcademySoftwareFoundation/openexr#2618) Update vendored libdeflate to 1.26 (by @cary-ilm/Cary Phillips) * [2599](AcademySoftwareFoundation/openexr#2599) Add support for loss HTJ2K compressor (LJ2K) (by @palemieux/Pierre-Anthony Lemieux) * [2581](AcademySoftwareFoundation/openexr#2581) Mark AcesInputFile/AcesOutputFile and exr2aces as deprecated (by @cary-ilm/Cary Phillips) * [2577](AcademySoftwareFoundation/openexr#2577) Revert "Add compression context cache (#2440)" (by @cary-ilm/Cary Phillips) * [2560](AcademySoftwareFoundation/openexr#2560) Refine colorInteropID support (by @doug-walker/Doug Walker) * [2525](AcademySoftwareFoundation/openexr#2525) Add check to avoid overflow, add tests for reading / writing many channels (by @kthurston/Kimball Thurston) * [2453](AcademySoftwareFoundation/openexr#2453) Use std::deque for IDManifest storage to keep references stable (by @mshooter-ilm/Moira Shooter) * [2443](AcademySoftwareFoundation/openexr#2443) Fix Imath include on CMake reconfigure (by @cary-ilm/Cary Phillips) * [2440](AcademySoftwareFoundation/openexr#2440) Add compression context cache (by @kdt3rd/Kimball Thurston) * [2435](AcademySoftwareFoundation/openexr#2435) Add setMaxImageSize/setMaxTileSize to python module (by @cary-ilm/Cary Phillips) * [2432](AcademySoftwareFoundation/openexr#2432) Add Python bindings for idManifest (IDManifest) header attribute (by @mshooter-ilm/Moira Shooter) * [2429](AcademySoftwareFoundation/openexr#2429) Check for xSize==0 in gaps fuzzer `part_exceeds_memory_limits` (by @cary-ilm/Cary Phillips) * [2428](AcademySoftwareFoundation/openexr#2428) Add required includes to website examples (by @ijayhub/Ijay) * [2419](AcademySoftwareFoundation/openexr#2419) Impose memory limits in `openexr_exrgaps_fuzzer` (by @cary-ilm/Cary Phillips) * [2418](AcademySoftwareFoundation/openexr#2418) Add support for multithreading in Python module (by @cary-ilm/Cary Phillips) * [2412](AcademySoftwareFoundation/openexr#2412) Ability to read/write from/to BytesIO buffers in Python API (by @mshooter-ilm/Moira Shooter) * [2401](AcademySoftwareFoundation/openexr#2401) test/oss-fuzz: add `openexr_exrgaps_fuzzer` (by @jortles/Anthony Hurtado) * [2391](AcademySoftwareFoundation/openexr#2391) Add new fuzzing harnesses that can be consumed by OSS-Fuzz (by @DavidKorczynski) * [2384](AcademySoftwareFoundation/openexr#2384) Completing ChannelList Iterator API (by @Arcmantis18/ArcMantis) * [2376](AcademySoftwareFoundation/openexr#2376) Include all Imath headers via #include <Imath/...> (by @cary-ilm/Cary Phillips) * [2369](AcademySoftwareFoundation/openexr#2369) Clarify #include policy and make usage consistent (by @cary-ilm/Cary Phillips) * [2309](AcademySoftwareFoundation/openexr#2309) Don't hardcode the python module install dir (by @antonio-rojas/Antonio Rojas) * [2276](AcademySoftwareFoundation/openexr#2276) Build oss-fuzz via oss-fuzz_build.sh (by @cary-ilm/Cary Phillips) * [2151](AcademySoftwareFoundation/openexr#2151) Remove iex_debugTrap() function (by @cary-ilm/Cary Phillips) * [2143](AcademySoftwareFoundation/openexr#2143) Make the release.py generic, so it works with Imath (by @cary-ilm/Cary Phillips) * [2117](AcademySoftwareFoundation/openexr#2117) Bump version on main branch to 4.0.0 (by @cary-ilm/Cary Phillips) ### Documentation Pull Requests * [2652](AcademySoftwareFoundation/openexr#2652) website: improve documentation code and equation formatting (by @QuantaDude/Abhirup Bhattacharyya) * [2651](AcademySoftwareFoundation/openexr#2651) Set 'align: left' for tables that had central text alignment in TechnicalIntroduction.rst for better formatting (by @dmitryshurov/Dmitry Shurov) * [2649](AcademySoftwareFoundation/openexr#2649) website: document LJ2K compression (by @QuantaDude/Abhirup Bhattacharyya) * [2647](AcademySoftwareFoundation/openexr#2647) website: compile documentation examples independently (by @QuantaDude/Abhirup Bhattacharyya) * [2638](AcademySoftwareFoundation/openexr#2638) Release notes for v3.5.0 (by @cary-ilm/Cary Phillips) * [2634](AcademySoftwareFoundation/openexr#2634) docs: Fix SECURITY.md formatting (by @lgritz/Larry Gritz) * [2624](AcademySoftwareFoundation/openexr#2624) Release notes and news for v3.4.15, v3.3.14, v3.2.12 (by @cary-ilm/Cary Phillips) * [2580](AcademySoftwareFoundation/openexr#2580) Release notes and news for v3.4.14, v3.3.13, v3.2.11 (by @cary-ilm/Cary Phillips) * [2549](AcademySoftwareFoundation/openexr#2549) Fix broken links identified in ASWF Health Check 2026 (by @cary-ilm/Cary Phillips) * [2512](AcademySoftwareFoundation/openexr#2512) Update security policy regarding CVE requests (by @cary-ilm/Cary Phillips) * [2501](AcademySoftwareFoundation/openexr#2501) Update SECURITY.md with CVE fixes from v3.4.12 and 3.4.13 (by @cary-ilm/Cary Phillips) * [2497](AcademySoftwareFoundation/openexr#2497) Release notes and news for v3.4.13, v3.3.12, and v3.2.10 (by @cary-ilm/Cary Phillips) * [2322](AcademySoftwareFoundation/openexr#2322) news and release notes for v3.4.8 and v3.4.7 (by @cary-ilm/Cary Phillips) * [2280](AcademySoftwareFoundation/openexr#2280) release notes and news for 3.4.6, 3.3.8, and 3.2.6 (by @cary-ilm/Cary Phillips) * [2275](AcademySoftwareFoundation/openexr#2275) Fix install doc to note vendored OpenJPH started with v3.4.6 (by @cary-ilm/Cary Phillips) * [2203](AcademySoftwareFoundation/openexr#2203) V3.4.4 news (by @cary-ilm/Cary Phillips) * [2195](AcademySoftwareFoundation/openexr#2195) Add copyright notices to website example code (by @cary-ilm/Cary Phillips) * [2172](AcademySoftwareFoundation/openexr#2172) release notes and news for v3.4.3, v3.3.6, and 3.2.5 (by @cary-ilm/Cary Phillips) * [2152](AcademySoftwareFoundation/openexr#2152) Release notes and news for v3.4.2 (by @cary-ilm/Cary Phillips) ### Merged Workflow Pull Requests * [2636](AcademySoftwareFoundation/openexr#2636) Bump vmactions/freebsd-vm from 1.5.5 to 1.5.6 * [2635](AcademySoftwareFoundation/openexr#2635) Bump the codeql group with 3 updates * [2631](AcademySoftwareFoundation/openexr#2631) Add Windows ARM64 Python wheel CI (by @xieofxie) * [2630](AcademySoftwareFoundation/openexr#2630) Bump pypa/cibuildwheel from 4.2.0 to 4.2.1 * [2576](AcademySoftwareFoundation/openexr#2576) Bump pypa/cibuildwheel from 4.1.1 to 4.2.0 * [2559](AcademySoftwareFoundation/openexr#2559) Bump pypa/cibuildwheel from 4.1.0 to 4.1.1 * [2537](AcademySoftwareFoundation/openexr#2537) Bump the codeql group with 3 updates * [2523](AcademySoftwareFoundation/openexr#2523) Group CodeQL GitHub Actions bumps in Dependabot. (by @cary-ilm/Cary Phillips) * [2521](AcademySoftwareFoundation/openexr#2521) Bump github/codeql-action/init from 4.36.2 to 4.36.3 * [2520](AcademySoftwareFoundation/openexr#2520) Bump github/codeql-action/upload-sarif from 4.36.2 to 4.36.3 * [2519](AcademySoftwareFoundation/openexr#2519) Bump github/codeql-action/analyze from 4.36.2 to 4.36.3 * [2477](AcademySoftwareFoundation/openexr#2477) Drop support for Python 3.8 (by @cary-ilm/Cary Phillips) * [2475](AcademySoftwareFoundation/openexr#2475) Bump pypa/cibuildwheel from 3.4.1 to 4.1.0 * [2459](AcademySoftwareFoundation/openexr#2459) Bump github/codeql-action from 4.36.0 to 4.36.2 * [2455](AcademySoftwareFoundation/openexr#2455) Bump actions/checkout from 6.0.2 to 6.0.3 * [2446](AcademySoftwareFoundation/openexr#2446) Bump openjph from 0.27.0 to 0.27.3.bcr.1 * [2410](AcademySoftwareFoundation/openexr#2410) Add missing quotes around ENV in src/test/oss-fuzz/CMakeLists.txt (by @cary-ilm/Cary Phillips) * [2400](AcademySoftwareFoundation/openexr#2400) Bump openjph from 0.26.3.bcr.1 to 0.27.0 * [2386](AcademySoftwareFoundation/openexr#2386) Bump rules_cc from 0.2.17 to 0.2.18 * [2371](AcademySoftwareFoundation/openexr#2371) Bump packaging from 26.0 to 26.1 * [2348](AcademySoftwareFoundation/openexr#2348) Bump requests from 2.32.5 to 2.33.0 in /website * [2347](AcademySoftwareFoundation/openexr#2347) Bump pygments from 2.19.2 to 2.20.0 in /website * [2286](AcademySoftwareFoundation/openexr#2286) Bump github/codeql-action from 4.32.4 to 4.32.5 * [2285](AcademySoftwareFoundation/openexr#2285) Bump scikit-build-core from 0.11.6 to 0.12.1 * [2284](AcademySoftwareFoundation/openexr#2284) Bump jmertic/slack-release-notifier from 5221a45213eddc6206886797beb079e091c93406 to 6fa159048d5313ff1177d248ad84beb627571670 * [2278](AcademySoftwareFoundation/openexr#2278) Bump actions/download-artifact from 7.0.0 to 8.0.0 * [2277](AcademySoftwareFoundation/openexr#2277) Bump actions/upload-artifact from 6.0.0 to 7.0.0 * [2206](AcademySoftwareFoundation/openexr#2206) Bump openjph from 0.25.2 to 0.25.3 * [2179](AcademySoftwareFoundation/openexr#2179) Bump readthedocs/actions from 1.2 to 1.5 * [2116](AcademySoftwareFoundation/openexr#2116) CI fixes: (by @cary-ilm/Cary Phillips)
1 parent 23bf734 commit 2ffc82e

5 files changed

Lines changed: 81 additions & 23 deletions

File tree

‎graphics/openexr/Makefile‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# $NetBSD: Makefile,v 1.90 2026/09/26 09:43:06 wiz Exp $
1+
# $NetBSD: Makefile,v 1.91 2026/09/28 14:39:29 wiz Exp $
22

3-
DISTNAME= openexr-3.4.15
4-
PKGREVISION= 1
3+
DISTNAME= openexr-3.5.1
54
CATEGORIES= graphics
65
MASTER_SITES= ${MASTER_SITE_GITHUB:=openexr/}
76
GITHUB_PROJECT= openexr

‎graphics/openexr/PLIST‎

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@comment $NetBSD: PLIST,v 1.29 2025/09/21 15:10:24 wiz Exp $
1+
@comment $NetBSD: PLIST,v 1.30 2026/09/28 14:39:29 wiz Exp $
22
bin/exr2aces
33
bin/exrenvmap
44
bin/exrheader
@@ -42,6 +42,7 @@ include/OpenEXR/ImfChannelListAttribute.h
4242
include/OpenEXR/ImfCheckFile.h
4343
include/OpenEXR/ImfChromaticities.h
4444
include/OpenEXR/ImfChromaticitiesAttribute.h
45+
include/OpenEXR/ImfColorMetadata.h
4546
include/OpenEXR/ImfCompositeDeepScanLine.h
4647
include/OpenEXR/ImfCompression.h
4748
include/OpenEXR/ImfCompressionAttribute.h
@@ -148,6 +149,7 @@ include/OpenEXR/openexr_attr.h
148149
include/OpenEXR/openexr_base.h
149150
include/OpenEXR/openexr_chunkio.h
150151
include/OpenEXR/openexr_coding.h
152+
include/OpenEXR/openexr_color_metadata.h
151153
include/OpenEXR/openexr_compression.h
152154
include/OpenEXR/openexr_config.h
153155
include/OpenEXR/openexr_context.h
@@ -162,25 +164,25 @@ lib/cmake/OpenEXR/OpenEXRConfig.cmake
162164
lib/cmake/OpenEXR/OpenEXRConfigVersion.cmake
163165
lib/cmake/OpenEXR/OpenEXRTargets-release.cmake
164166
lib/cmake/OpenEXR/OpenEXRTargets.cmake
165-
lib/libIex-3_4.so
166-
lib/libIex-3_4.so.33
167-
lib/libIex-3_4.so.33.${PKGVERSION}
167+
lib/libIex-3_5.so
168+
lib/libIex-3_5.so.34
169+
lib/libIex-3_5.so.34.${PKGVERSION}
168170
lib/libIex.so
169-
lib/libIlmThread-3_4.so
170-
lib/libIlmThread-3_4.so.33
171-
lib/libIlmThread-3_4.so.33.${PKGVERSION}
171+
lib/libIlmThread-3_5.so
172+
lib/libIlmThread-3_5.so.34
173+
lib/libIlmThread-3_5.so.34.${PKGVERSION}
172174
lib/libIlmThread.so
173-
lib/libOpenEXR-3_4.so
174-
lib/libOpenEXR-3_4.so.33
175-
lib/libOpenEXR-3_4.so.33.${PKGVERSION}
175+
lib/libOpenEXR-3_5.so
176+
lib/libOpenEXR-3_5.so.34
177+
lib/libOpenEXR-3_5.so.34.${PKGVERSION}
176178
lib/libOpenEXR.so
177-
lib/libOpenEXRCore-3_4.so
178-
lib/libOpenEXRCore-3_4.so.33
179-
lib/libOpenEXRCore-3_4.so.33.${PKGVERSION}
179+
lib/libOpenEXRCore-3_5.so
180+
lib/libOpenEXRCore-3_5.so.34
181+
lib/libOpenEXRCore-3_5.so.34.${PKGVERSION}
180182
lib/libOpenEXRCore.so
181-
lib/libOpenEXRUtil-3_4.so
182-
lib/libOpenEXRUtil-3_4.so.33
183-
lib/libOpenEXRUtil-3_4.so.33.${PKGVERSION}
183+
lib/libOpenEXRUtil-3_5.so
184+
lib/libOpenEXRUtil-3_5.so.34
185+
lib/libOpenEXRUtil-3_5.so.34.${PKGVERSION}
184186
lib/libOpenEXRUtil.so
185187
lib/pkgconfig/OpenEXR.pc
186188
share/doc/OpenEXR/examples/deepExamples.cpp

‎graphics/openexr/distinfo‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
$NetBSD: distinfo,v 1.78 2026/08/23 07:48:26 wiz Exp $
1+
$NetBSD: distinfo,v 1.79 2026/09/28 14:39:29 wiz Exp $
22

3-
BLAKE2s (openexr-3.4.15.tar.gz) = 3bd491d330eb68ba034610fc9367d65e54f335766f0279139b78290f26526d55
4-
SHA512 (openexr-3.4.15.tar.gz) = bdb45dc5af9669f845ec2c5c7cdda45ba46d8e178eb1a2754b8737944c9baef13a48e52e524c6bddefbf3aac770f899fb38147e26059a08dd70fdab879e14ed0
5-
Size (openexr-3.4.15.tar.gz) = 25838055 bytes
3+
BLAKE2s (openexr-3.5.1.tar.gz) = ca85ac8c9fd77582124fec04b410fcfdcc9e03c03ff65206b800af84a2358b44
4+
SHA512 (openexr-3.5.1.tar.gz) = c8ac983cfa48b2ff73ee27bde498eb0d33946533eabf51c1ff60399b2e6e2b7557607d123f75b2f9759b01a921475ab2f1eafe3f974a092e7b0035800634cfc7
5+
Size (openexr-3.5.1.tar.gz) = 26400002 bytes
6+
SHA1 (patch-src_lib_OpenEXRCore_internal__ht__common.h) = 5a3e4cff4831611fdff3e07cc0cbfc1e6acfad9d
7+
SHA1 (patch-src_lib_OpenEXRCore_internal__ht__quality.h) = e16ae3e65e772bb053806c15ae8b5f884eaf5946
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
$NetBSD: patch-src_lib_OpenEXRCore_internal__ht__common.h,v 1.1 2026/09/28 14:39:29 wiz Exp $
2+
3+
Fix build on NetBSD.
4+
https://github.com/AcademySoftwareFoundation/openexr/issues/2681
5+
6+
--- src/lib/OpenEXRCore/internal_ht_common.h.orig 2026-09-28 14:32:55.547276802 +0000
7+
+++ src/lib/OpenEXRCore/internal_ht_common.h
8+
@@ -10,7 +10,7 @@
9+
#include <float.h>
10+
#include <stdint.h>
11+
#include <stdlib.h>
12+
-#include <math.h>
13+
+#include <cmath>
14+
#include <string.h>
15+
#include <half.h>
16+
#include "openexr_coding.h"
17+
@@ -232,7 +232,7 @@ static inline int32_t float_to_int32(float h)
18+
*/
19+
static inline int32_t float_to_int32(float h)
20+
{
21+
- if (isnan (h)) return 0;
22+
+ if (std::isnan (h)) return 0;
23+
double v = round (tf_from_linear ((double) h) * INT32_FLOAT_FACTOR);
24+
if (v > (double) INT32_MAX) return INT32_MAX;
25+
if (v < -(double) INT32_MAX) return -INT32_MAX;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
$NetBSD: patch-src_lib_OpenEXRCore_internal__ht__quality.h,v 1.1 2026/09/28 14:39:29 wiz Exp $
2+
3+
Fix build on NetBSD.
4+
https://github.com/AcademySoftwareFoundation/openexr/issues/2681
5+
6+
--- src/lib/OpenEXRCore/internal_ht_quality.h.orig 2026-09-28 14:35:15.632016677 +0000
7+
+++ src/lib/OpenEXRCore/internal_ht_quality.h
8+
@@ -6,7 +6,13 @@
9+
#ifndef OPENEXR_PRIVATE_HT_QUALITY_H
10+
#define OPENEXR_PRIVATE_HT_QUALITY_H
11+
12+
+#ifdef __cplusplus
13+
+#include <cmath>
14+
+#define _OPENEXR_ISFINITE std::isfinite
15+
+#else
16+
#include <math.h>
17+
+#define _OPENEXR_ISFINITE isfinite
18+
+#endif
19+
20+
/** Lower bound of the valid range for the LJ2K lossy quality level. */
21+
#define MIN_LOSSY_HTJ2K_QUALITY 1.f
22+
@@ -17,7 +23,7 @@ is_lossy_htj2k_quality (float q)
23+
static inline int
24+
is_lossy_htj2k_quality (float q)
25+
{
26+
- return isfinite (q) && q >= MIN_LOSSY_HTJ2K_QUALITY &&
27+
+ return _OPENEXR_ISFINITE (q) && q >= MIN_LOSSY_HTJ2K_QUALITY &&
28+
q <= MAX_LOSSY_HTJ2K_QUALITY;
29+
}
30+

0 commit comments

Comments
 (0)