ddata[1] (packed_size) and ddata[2] (unpacked_size) both had
'< 0 || > INT_MAX' guards, but ddata[0] (sample_count_table_size)
only had '< 0'. A value > INT_MAX stored in the uint64_t field then
gets truncated to size_t on ILP32, causing an undersized allocation
followed by a heap overflow when exr_read_deep_chunk writes the full
64-bit byte count into it.
Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-m5cq-cx25-qw53
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix exrmultiview heap OOB when union dataWindow misaligns with subsampling
Validate the combined data window against each input channel's x/y
subsampling before allocating pixel buffers or calling readPixels,
matching ImfHeader checks. Reject misaligned unions with ArgExc instead
of reading past undersized buffers.
Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-gjf7-wjjw-xq56
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
* Reject all input with sampling != 1
Subsampling is rare, and exrmultiview not commonly used, so this
solution seems cleaner: just don't handle subsampling at all.
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep init, analyze, and upload-sarif on the same version so partial
updates do not break the CodeQL workflow with a version mismatch.
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
NumPy 2.5+ no longer ships manylinux_2_17 wheels and requires
GCC >= 10.3 when building from source. The manylinux2014
containers only provides GCC 10.2.1, so cibuildwheel's test phase fails
when pip cannot install numpy.
Use manylinux_2_28 for aarch64, x86_64, and i686 builds (GCC 11, glibc
2.28), which has compatible pre-built numpy wheels and satisfies the
compiler requirement.
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
setDeepSliceData() used strcmp(c.name(), "G"/"B"/"A") to select the
RGB channel offset, which only matched unprefixed channel names. For
layer-prefixed channels like left.G and left.B the comparison failed,
leaving channels 1 and 2 pointing at their initial (stale heap) data
while channel 0 received all decoded samples.
Fix: check only the final character of the channel name, consistent
with how channelNameToRGBA() already identifies the channel suffix.
Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-pf59-r2mc-x746
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
extract_attr_float_vector reads the float array into attrdata->arr, then
called priv_to_native32(attrdata, n). On big-endian hosts that swaps the
first n 32-bit words of the exr_attr_float_vector_t struct itself (the
arr pointer and length) instead of the n floats in attrdata->arr. The
corrupted pointer and length then crash when the value is read back, for
example a std::bad_alloc or segfault while constructing the FloatVector
in the C++ Context::header path.
Swap attrdata->arr instead. priv_to_native32 is a no-op on little-endian,
so x86_64 and ppc64le are unaffected.
Verified on POWER8: OpenEXR.testAttributes segfaults on big-endian ppc64
before this change and passes after.
Signed-off-by: Scott Boudreaux <121303252+Scottcjn@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
Deep and flat reads with separate_channels=False assumed all coalesced
R/G/B channels share one PixelType, which could undersize NumPy buffers
and cause heap corruption on decode. Validate types before reading and
propagate invalid_argument to Python; add regression tests.
For example, if the file has left.R, left.G, left.B, it's an error to
request an RGB pixel array if "left.R" is FLOAT and "left.G" is HALF.
However, it's OK for all "left" channels to be FLOAT and all "right" channels
to be HALF.
Note also that attempting to combine mixed-type channels causes a
failure to read the entire file, whereas other read errors simply skip
the offending part. This is reasonable behavior since the condition is
not a defect in the data itself, but simply an inability to return the
data in the format the user requested.
Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-994f-rr2m-9r7x
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
compute_scratch_buffer_size() returns uint64_t, but
internal_decode_alloc_buffer() takes size_t. On ILP32 builds the
implicit conversion silently truncates scratch sizes above 4 GiB,
causing uncompress_b44_impl() to write far past the undersized
allocation using the attacker-controlled channel width.
Add an explicit truncation check before both the B44 and B44A scratch
buffer allocations: if the required size exceeds SIZE_MAX, return
EXR_ERR_OUT_OF_MEMORY rather than allocating a truncated buffer.
Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-92pq-9qv4-g68q
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Name::operator= leaves the string without a terminating null if the
string is longer than MAX_LENGTH. Write a null to ensure there is one.
Signed-off-by: Cary Phillips <cary@ilm.com>
Validate the source rgba pointer before memcpy in
exr_attr_preview_create() and the same-dimensions update path in
exr_attr_set_preview(), preventing a NULL pointer dereference when
nonzero preview dimensions are supplied without pixel data.
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix integer overflow in Array2D::resizeErase() on ILP32/LLP64 builds
sizeX * sizeY used long arithmetic, which is 32 bits on ILP32 (32-bit
Linux) and on Windows (MSVC LLP64). A tile size of 65537x65537 overflows
to a small positive value, causing new[] to under-allocate and subsequent
tile decoding to write past the buffer.
Cast both operands to size_t before multiplying so the allocation is
always correct regardless of the width of long.
Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-f667-c4wm-c8gq
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
* validate non-negative sizes
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
In update_pack_unpack_ptrs(), sampsize was computed as size_t, so on
ILP32 builds a tile with width*height >= 2^30 wraps to zero (or four
with the INDIVIDUAL flag), causing the sample-count table to be
allocated too small and unpack_sample_table() to read far past it.
Compute the size in uint64_t, check for truncation before converting
to size_t, and return EXR_ERR_OUT_OF_MEMORY if the required size
exceeds SIZE_MAX.
Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-p42q-g5c9-mh9w
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
In update_pack_unpack_ptrs(), decode->chunk.unpacked_size is uint64_t
but was passed directly to internal_decode_alloc_buffer() which takes
size_t. On ILP32 builds a crafted chunk with unpacked_size > 4 GiB
silently truncates, allocating a tiny buffer while the decompressor
and unpacker iterate over the full declared channel width, causing an
out-of-bounds read.
Add a truncation check before the allocation and return
EXR_ERR_OUT_OF_MEMORY if unpacked_size exceeds SIZE_MAX.
Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-v6v5-344m-64vm
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
When --pixelmode float (or --bench) is used, outHeader channels are
rewritten from the input type (e.g. HALF) to FLOAT. The DeepSlice
framebuffer entries were already built from outHeader, requesting 4-byte
FLOAT writes. However, the sample data buffers were allocated using the
*input* header's channel types (2 bytes for HALF), so readPixels() wrote
4-byte values into 2-byte buffers — a heap buffer overflow.
Fix: allocate sampleData using outHeader.channels() (the output/requested
type) so that buffer sizes match the per-sample write size.
Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-6jj8-cxcr-j8hm
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
GitHub Actions deprecated Node 20 and now forces Node 24 by default,
which requires glibc >= 2.25. The VFX 2021/2022 containers are CentOS
7 (glibc 2.17) and can't run Node 24, breaking the checkout step.
Set ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true to allow the runner
to use the Node 20 glibc-2.17 build installed in /node20217, which
is the existing workaround for these old containers.
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Both macOS matrix jobs previously built x86_64, arm64, and universal2,
producing duplicate wheel filenames. Prior to #2433, the workflow
downloaded each built wheel in succession, which would cause the
duplicate wheel to overwrite the original, but it avoided an
error. The new merge-multiple in the publish job corrupt the
files, causing TestPyPI uploads to fail with "Mis-matched data size".
This change builds x86_64 and universal2 on macos-15-intel and arm64
on macos-latest so merged artifacts have unique names.
This also adds a validation step to the python-wheels.yml workflow to
ensure the wheels have the expected structure.
Signed-off-by: Cary Phillips <cary@ilm.com>
EXR_LOCK_WRITE_AND_DEFINE_PART() acquires the mutex on write contexts
but both success and error returns leaked the lock, deadlocking later
API calls such as exr_get_count().
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
3.8 was never actually included in any vfx reference platform year,
and the platform has been at Python 3.9+ since CY2022. And
cibuildwheel 4.0 drops support for 3.8.
This will take effect in OpenEXR v3.5.
Signed-off-by: Cary Phillips <cary@ilm.com>
Validate non-null pointers when hint length or data size is non-zero,
and apply the same checks in the in-place exr_attr_set_bytes() path.
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Reject sample counts above 0x80000000 before rounding up to the next
power of two, since larger values cause the unsigned shift loop to wrap
and never terminate.
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The hard-coded 4_0 release number in the new install manifest should
have been converted to a symbolic value.
Signed-off-by: Cary Phillips <cary@ilm.com>
`internal_exr_undo_b44a()` was missing `exrcore_ensure_b44_tables()`, so
decode-only paths produced empty output. Add the call to mirror
`internal_exr_undo_b44()`.
Addresses #2447
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
When a static build of OpenEXR uses the vendered version of OpenJPH,
the cmake config still reports a dependency on OpenJPH, so downstream
applications attempthing to configure against OpenEXR can fail with a
missing OpenJPH dependency where none should exist.
Solution: build the vendored OpenJPH as an OBJECT librry and pull its
object files into OpenEXRCore via `target_sources(... PRIVATE
$<TARGET_OBJECTS:openjph>)`. This removes OpenJPH as a dependent
library altogether, for both shared and static builds. Note this
applies only to th vendored version of OpenJPH, where the intention is
to hide any external dependency.
CMake:
- `OpenEXRSetup.cmake`: add `OPENEXR_USE_INTERNAL_OPENJPH` (0/1 internal
cache) set when the internal tree is used.
- `OpenEXRConfig.cmake.in`: call `find_dependency(openjph)` only when
`OPENEXR_USE_INTERNAL_OPENJPH` is false.
Vendored OpenJPH tree:
- `OJPH_INSTALL` option wraps `install(EXPORT)`, `pkg-config`, and
target/header install so OpenEXR builds with vendored OpenJPH can
disable all OpenJPH installation steps.
- `OJPH_LIB_TYPE` defaults to `STATIC` but OpenEXRCore forces it to
`OBJECT`. bundling; vendor script can reapply STATIC on refresh.
OpenEXRCore:
- Force `OJPH_INSTALL OFF`, `OJPH_LIB_TYPE` to `OBJECT`
- Replace `PRIVATE` link to openjph with `TARGET_OBJECTS` and optional
INTERFACE compile definitions from openjph.
vendor_openjph.sh:
- Document and reapply OpenEXR patches on vendor code update: remove
`BUILD_SHARED_LIBS` option, add `OJPH_INSTALL` and `OJPH_LIB_TYPE`, wrap
install blocks with `if (OJPH_INSTALL)`.
Also adds a CI test to validate the static build w/vendored OpenJPH.
Addresses #2439
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* Expose IDManifest and ChannelGroupManifest in the PyOpenEXR module so Python can read and write the compressed idManifest header attribute.
- Decode IDManifestAttribute on read; encode IDManifest on write
- Bind ChannelGroupManifest (insert, find, erase, merge, << chaining)
- Add test_id_manifest.py and manifest_id.exr
Signed-off-by: Moira Shooter <mshooter@ilm.com>
* fix python3.11 window crash idmanifest iter binding
Signed-off-by: Moira Shooter <mshooter@ilm.com>
* vector reallocation could invalidate ChannelGroupManifest& values returned
from add() when another group was appended. That showed up in Python tests
on macOS and affects any C++ code that keeps those references.
Also simplify test_id_manifest.py
Signed-off-by: Moira Shooter <mshooter@ilm.com>
---------
Signed-off-by: Moira Shooter <mshooter@ilm.com>
While working on the new Python bindings #1812, we ran into a crash on
macOS where references to existing ChannelGroupManifest elements were
getting wiped out. This happens because std::vector reallocates its
memory under the hood as it grows, invalidating active references.
Switching to std::deque fixes this by guaranteeing that pointers and
references stay perfectly stable when elements are added. Performance-wise,
std::deque still gives us constant-time O(1) random access, so the public
operator[] won't see any index-traversal slowdowns.
Relates to PR #2432
Fixes: Part of #1812
Signed-off-by: Moira Shooter <mshooter@ilm.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
* Break release.py into separate small scripts for each step
It's much easier to follow the logic this way than having everything
in a single file.
log.py - Prints PRs w/labels and CVE/OSS-Fuzz issues
cherry.py - Reports commits to cherry pick
changes.py - Adds entries to CHANGES.md release notes
tag.py - creates a tag with release notes as message
candidate.py - Formats the release candidate mail
draft.py - Draft the GitHub release w/notes
This also updates the release instructions in CONTRIBUTING.md
Signed-off-by: Cary Phillips <cary@ilm.com>
* fixes
Signed-off-by: Cary Phillips <cary@ilm.com>
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
* Consistent date formatting
Don't use "%e" since it forces two columns
Signed-off-by: Cary Phillips <cary@ilm.com>
* improve usage messages
Signed-off-by: Cary Phillips <cary@ilm.com>
* more usage message updates
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Remove the `OPENEXR_IMATH_SUBDIR_INCLUDE_PATCH` cache guard so
internal-Imath include directories are re-applied on every configure.
Add a configure-twice smoke test to CI for internal-Imath builds to
catch this class of regression.
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix integer overflow in internal_dwa_encoder.h
Cast width and height to size_t and change the tmpHalfBufferElements to size_t
to avoid overflow and potential crash.
Signed-off-by: Lumina Wang <lumina.wang@autodesk.com>
* Fix integer overflow in part_attr.c
Cast width and height to size_t to fix overflow and crash.
Signed-off-by: Lumina Wang <lumina.wang@autodesk.com>
* Fix integer overflow in encoding.c
Since priv_to/from_native32(void*, int) are widely used, instead of changing the
function definition, process the sample count table line by line to fix a crash
related to integer overflows.
Signed-off-by: Lumina Wang <lumina.wang@autodesk.com>
---------
Signed-off-by: Lumina Wang <lumina.wang@autodesk.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
* Adding feature which allows the disk sizes of induvidual parts in a multipart EXR to be printed as one of the exrmetrics stats. The current method only works when no output file is specified because we use the write position of the dummy output stream to derive bytes written per part. Added flag to enable part size printout.
Signed-off-by: Aries Moczar <arcmantis@protulae.com>
* Improved help description. Appended to website/bin/exrmetrics.rst
Signed-off-by: Aries Moczar <arcmantis@protulae.com>
* Improved help message to be more clear. Modified parse() to report error when user attempts to use --part-disk-size and -o or vice versa in command. Added test in test_exrmetrics.py to verify json ouput for --part-disk-size.
Signed-off-by: Aries Moczar <arcmantis@protulae.com>
---------
Signed-off-by: Aries Moczar <arcmantis@protulae.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
PR #2148 extends the python module to skip over parts with
invalid/unfinished pixel data, so it reads what it can. Reading
"header_only" reads all headers.
This adds a test to validate that behavior, using a test file with
corrupted chunk tables in two of the parts.
Made-with: Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add support for multithreading in Python module
The `OpenEXR.File` object now takes a `num_threads` argument
specifying the number of threads for I/O (passed directly to the
`MultiPartInputFile/MultiPartOutputFile` object constructors).
`OpenEXR.set_global_thread_count(int)` specifies the number of worker
threads for the process-wide thread pool (calls
`Imf::setGlobalThreadCount`), and `OpenEXR.global_thread_count()`
returns the current value.
This also fixes a bug where the `File` object destructor was clearing
the channel dict and pixel numpy arrays even if they are owned by the
caller, a bug revealed by the new multithreading test.
Signed-off-by: Cary Phillips <cary@ilm.com>
* -1 as default num_threads invokes globalThreadCount(), and clarify docs.
The documentation now clarifies that set_global_thread_count() should
be called only during initialization, not interleaved with File
reads/writes.
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* remove errant include
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* add test for combo of start line, lines per compression, y samples
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* fix compute of sampled height
When there are strange y_sampling, the number of lines per chunk was not
being computed correctly depending on how the start position lines up
with the sampling
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Apply suggestion from @cary-ilm
remove debugging printf
Signed-off-by: Cary Phillips <cary@ilm.com>
* Apply suggestion from @cary-ilm
remove debugging printf
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
This applies the memory limits in effect in `openexr_exrcheck_fuzzer`
to the new `openexr_exrgaps_fuzzer`. Without the limits, the fuzzer
can generate test case images that are valid but exceed the limits of
the fuzzing environment.
Addresses https://issues.oss-fuzz.com/issues/513282267
Addresses https://issues.oss-fuzz.com/issues/512988066
Made-with: Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>
* fix memory leak in test only - invalid api call
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* simplify string init
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* refactor part memory handling for parts
failing to add a part was not reverting cleanly. However, when
reverting, the array storing the list of the parts was not being updated
correctly, causing more potential memory leaks with lots of failures.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
---------
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
This commit fixes the issue where an unfinished multi-part file could
not be loaded properly in the python warpper for OpenEXR. This happens
when headers for the multi-part file are written to disk but the actual
pixels never finish being written.
The current fix skips the corrupted or empty parts with no pixel data
while retaining the ability for loading the correct ones.
Signed-off-by: dendenxu <zhenx@zju.edu.cn>
Co-authored-by: Cary Phillips <cary@ilm.com>
Otherwise, if FUZZING_ENGINE or LIB_FUZZING_ENGINE are not set, the
cmake statements yield confusing invalid syntax.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Check for invalid Slice base and type in TileProcess::copy_sample_count
Reject as invalid if the framebuffer has no sample counts, or they're
not UINTs.
Addresses https://issues.oss-fuzz.com/issues/512895184
Made-with: Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>
* add higher-level slice guards
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
Closes#2023
Summary:
if datawindow != the size of the numpy buffers, the library could still try to write.
That put native code in a bad state and could crash the process instead of reporting a normal Python error.
This change adds a safety check before writing: when we are writing those numpy buffers under the simple case where channels are not subsampled, we verify that the dataWindow width and height line up with the array dimensions. If they do not, we fail immediately with a clear error so callers can fix the header or the array shape.
Added unit test
Made-with: Cursor
Signed-off-by: Moira Shooter <mshooter@ilm.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
Summary:
Adds binary stream support to the new Python OpenEXR.File API so EXRs can be read from and written to in-memory buffers (e.g. io.BytesIO) without going through a temp file. Implements IStream / OStream adapters backed by Python read / write, tell, and seek, wired to MultiPartInputFile / MultiPartOutputFile.
Tests:
test_unittest.py: BytesIO read vs disk; write ? BytesIO ? read round-trip.
test_images.py: same compare_files checks against the openexr-images corpus for BytesIO read and write(BytesIO) ? read back.
Note : Had to clone https://github.com/AcademySoftwareFoundation/openexr-images.git
and run
setenv OPENEXR_TEST_IMAGE_REPO <path-to-openexr-images>
when running the tests
Made-with: Cursor
Signed-off-by: Moira Shooter <mshooter@ilm.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
* Added OPENEXR_DEPRECATED to function WidenFilename indicating its future removal
Signed-off-by: Aries Moczar <arcmantis@protulae.com>
* Disable warnings of deprecated WidenFilename in unit-tests
Signed-off-by: Aries Moczar <arcmantis@protulae.com>
* Corrected compiler check from _WIN32 to _MSC_VER. Added additional conditions for __clang__ and __GNUC__.
Signed-off-by: Aries Moczar <arcmantis@protulae.com>
* Added TODO comments indicating pragmas disabling deprecation-warnings should be removed once WidenFilename is removed.
Signed-off-by: Aries Moczar <arcmantis@protulae.com>
* Tightened pragmas around WidenFilename to be more precise when disabling deprectation warnings
Signed-off-by: Aries Moczar <arcmantis@protulae.com>
---------
Signed-off-by: Aries Moczar <arcmantis@protulae.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
* test/oss-fuzz: add openexr_exrgaps_fuzzer
Adds a third oss-fuzz fuzzer that complements the existing two
(openexr_exrcheck_fuzzer and openexr_exrcorecheck_fuzzer) by
exercising API surfaces those two cannot reach:
- TiledInputPart::readTile with adversarial coordinate sequencing,
stressing the tile cache and ripmap level resolution beyond what
checkOpenEXRFile()'s lexicographic loop covers.
- TiledInputPart::readTiles with attacker-controlled (dx1,dx2,dy1,dy2)
ranges rather than the natural full-image range.
- DeepTiledInputPart::readTile with attacker-controlled coordinates.
- MultiPartInputFile::header(p) iteration in reverse part order, with
per-attribute name lookup, exercising the part-cache and the
typed-attribute path.
The harness shares the same plain LLVMFuzzerTestOneInput pattern as
the existing fuzzers, the same BSD-3-Clause header, and links against
the same OpenEXR / OpenEXRUtil targets via the existing foreach loop
in CMakeLists.txt.
Signed-off-by: Anthony Hurtado <amhurtado@pm.me>
* test/oss-fuzz: address Copilot review on openexr_exrgaps_fuzzer
Six fixes from the Copilot review of #2401:
1. read_u32(): cast each byte to uint32_t before shifting/ORing.
The previous form left-shifted promoted-to-int values, which is
undefined behavior in C++ when the shifted value would set the sign
bit.
2. write_temp(): handle short writes and EINTR. The single write()
call could legally return early or be interrupted, causing valid
inputs to be silently dropped. Loop until the full buffer is
written, retrying on EINTR.
3. Add explicit #include <algorithm> for std::min, which was
previously relying on transitive inclusion. Also add <cerrno>.
4. Mode 0 (test_tiled_random_coords): replace
`if (hdr.find("type") != hdr.end()) continue;` with a check on
the actual type value. MultiPartInputFile auto-synthesizes a
"type" attribute when missing, so the previous check effectively
skipped every part. Mirror the fix in test_deep_tiled to require
hdr.type() == DEEPTILE explicitly. Use Imf::DEEPTILE constants
from ImfPartType.h.
5. Mode 1 (test_tiled_range): clamp the (dx2-dx1+1)*(dy2-dy1+1)
product so a single readTiles() call requests at most
kMaxRangeSide^2 = 64 tiles, down from the prior 32x32 = 1024.
Improves fuzz throughput on valid tiled inputs without losing
coverage of small-range and boundary cases.
6. CMakeLists.txt: replace the duplicated fuzzer list in the
oss_fuzz custom target's DEPENDS with ${OPENEXR_FUZZERS}, so the
list is maintained in one place.
Signed-off-by: Anthony Hurtado <amhurtado@pm.me>
* test/oss-fuzz: refresh exrgaps fuzzer header comment
Drop the now-stale "companion to exrcheck/exrcorecheck" framing since
more fuzzers have landed since this was written, and reword the leading
sentence to refer to all checkOpenEXRFile-based fuzzers collectively.
Signed-off-by: Anthony Hurtado <amhurtado@pm.me>
---------
Signed-off-by: Anthony Hurtado <amhurtado@pm.me>
* Relax NaN comparison in compression tests
`compareExact(float)` currently requires bitwise equality, even for
NaN, but C vs C++ EXR can generate NaNs that are not bit-wise
identical, leading to reports of failures on various architectures.
This fixes the failures noted in #1281, #1460, #1628 in
the `test*Compression` tests, of the form:
F float at 59, 0 not equal: C++ loaded C 0x7fc4e364 (nan) vs C loaded C 7f84e364 (nan)
and in `testOptimizedInterleavePatterns`:
error reading back channel B pixel 21,-76 got -nan expected -nan
This change takes the conservative approach and relaxes the bitwise
comparison only for the architectures that are known to have NaN
differences.
This also changes the method of bitwise comparison of float
values. The C++ standard does not guarantee that writing one field of
a union and reading another is well-defined, and we've seen cases of
it failing with Intel's oneAPI. This changes the comparison to use
`memcpy` to a `uint32_t` instead of a union.
Made with Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>
* remove extraneous bothNan
Signed-off-by: Cary Phillips <cary@ilm.com>
* Use test on all architectures
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
Adds a handful of new fuzzing harnesses that can be run by way of
OSS-Fuzz. The main goal is to increase the code covered, e.g. in a
recent report approximately 16000 lines of code are covered:
https://storage.googleapis.com/oss-fuzz-coverage/openexr/reports/20260420/linux/src/report.html
With the new fuzzing harnesses here, the total number of lines covered
increases above 25000 from a short run, so I anticipate it will go a
good amount larger.
Signed-off-by: David Korczynski <david@adalogics.com>
Signed-off-by: DavidKorczynski <david@adalogics.com>
* Cast to `size_t` to avoid int overflow in `ht_undo_impl`
`width` is `int32_t` and `bytes_per_element` is `int16_t`, so the raw
product can overflow 32 bits before the cast to `size_t`; cast each
term to `size_t` before the multiplication.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update src/lib/OpenEXRCore/internal_ht.cpp
Co-authored-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update src/lib/OpenEXRCore/internal_ht.cpp
Co-authored-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update src/lib/OpenEXRCore/internal_ht.cpp
Co-authored-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
* Report EXR_ERR_CORRUPT_CHUNK if computedoffset overflows size_t
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Pierre-Anthony Lemieux <pal@sandflow.com>
* Clarify #include policy and make usage consistent
This explains the OpenEXR policy regarding the "OpenEXR/" subdirectory
for include files: headers are installed under the "OpenEXR"
subdirectory, and the library supports application code that uses
either the bare header or the "OpenEXR subdirectory, i.e either one
of:
#include <ImfHeader.h>
#include <OpenEXR/ImfHeader.h>
Both cmake config and pkg-config add -I$include and -I$include/OpenEXR
as compilation args.
This policy is explained for users in the "Header Layout and #include
Policy" section in website/install.rst.
Internally, all library and tool source includes bare headers, without
the "OpenEXR" since the source tree maintains headers local to each
library, not in a common OpenEXR directory. The only exception is code
in the source tree that is expected to mimic example application code.
Internally, all library and tool source includes files via quotes ""
when the header in question is either in the local directory or is one
of the public headers installed in the OpenEXR. Others are included
via brackets <>. Previously, this was inconsistent. Imath headers
are included via <> because they come from another project.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add note about local header #include to install.rst
Signed-off-by: Cary Phillips <cary@ilm.com>
* separate header sections for applications vs. internal builds
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* Added additional operator overloads '--', '*' and '->' for ChannelList::Iterator and ChannelList::ConstIterator. Also added global operator overloads '==' and '!=' for Iterator class.
(issue #1325)
Signed-off-by: Aries Moczar <arcmantis@protulae.com>
* Added '==' and '!=' overloads for mixed Iterator and ConstIterator comparisons. Added Iterator and ConstIterator traits.
Signed-off-by: Aries Moczar <arcmantis@protulae.com>
* Added test to testChannels unit-test to verify functionality of ChannelList::Iterator/ConstIterator
Signed-off-by: Aries Moczar <arcmantis@protulae.com>
---------
Signed-off-by: Aries Moczar <arcmantis@protulae.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
The new section mentions the requirement for Python development
install (not just the interpeter), and pybind11, and also mentions the
cmake variables for directing the build to a specific Python install.
Inspired by #1603.
Signed-off-by: Cary Phillips <cary@ilm.com>
This prevents some corruption when filling buffers where these sizes
were trusted but not fully validated to be sane ahead of time
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Fix int overflow in ImageChannel::resize pixel count
Compute `_numPixels` with `uint64_t` after validating subsampled
dimensions, and reject products larger than `SIZE_MAX`. Prevents
undersized `new[]` in `TypedFlatImageChannel` and
`TypedDeepImageChannel` when `width*height` overflows signed int.
Made-with: Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>
* Remove the `(_pixelsPerRow < 0 || _pixelsPerColumn < 0)` test, since
the width and height have already been validated.
But an extra test *is* necessary in ImageChannel::resize() to validate
that xSampling and ySampling are not 0. This adds the validation check
but also adds a test to the test suite to validate handling of bad
sampling values.
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* Harden IDManifest parsing against illegal shift and string prefix OOB
`readVariableLengthInteger()` must not apply `(byte & 127) << shift`
when `shift >= 64`; that is undefined behavior for `uint64_t` and
could yield corrupted lengths for string list parsing. Reject
encodings that exceed representable shifts.
When decoding compressed string lists, the common-prefix length is
encoded with one or two leading bytes depending on whether the
previous string exceeded 255 characters. Require each string to be at
least that many bytes before reading those prefix bytes, avoiding
out-of-bounds indexing on undersized entries.
Made with Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>
* Remove minPrefixLen test that duplicates PR #2377
That fix belongs in #2377, not combined with the shift fix.
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
Validate each string has enough bytes for the 1- or 2-byte
common-prefix encoding before indexing. Prevents heap OOB read when
the previous string is long and the current entry is empty or too
short.
Made with Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>
If the release signing fails for some reason when triggered by the
release publish, this gives a way to force run it.
Signed-off-by: Cary Phillips <cary@ilm.com>
This adds a note to the source code and the website documentation that
clarifies that `const char*` filename arguments are assumed to be
UTF-8 encoded.
It also adds a test to validate the handling of non-ascii filenames by
isOpenExrFile().
Signed-off-by: Cary Phillips <cary@ilm.com>
`width` and `height` are `int32_t`; cast to `size_t`, since the result
is a pointer offset, to avoid overflow.
Signed-off-by: Cary Phillips <cary@ilm.com>
With this change, when `configure_install_prefix` is provideed, the CI
configures and builds with one install prefix but then overrides that
in the install step with an explicit `--prefix <path>`. This validates
that the custom prefix takes precedence over the cache.
This is done for the matrix builds that test with various settings
off, so it's sure to catch both with and without the overriding
prefix.
The `--install` option is only available in cmake 3.15+, but the
OpenEXR supported version of cmake is still 3.14 (so that's what the
CI uses), so the CI uses 3.15 for these builds.
Signed-off-by: Cary Phillips <cary@ilm.com>
Use refs/pull/<n>/head and the PR head SHA when uploading results so
Dependabot and other branch refs are not required by the Code Scanning
API (avoids ref not found errors).
Made-with: Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add CVE-2026-34589,34588,34545,34544,34543,34380,34379,34378 to SECURITY.md
Signed-off-by: Cary Phillips <cary@ilm.com>
* Replace explicit lists with ranges
Signed-off-by: Cary Phillips <cary@ilm.com>
* update with 3.2 and 3.3 patches
Signed-off-by: Cary Phillips <cary@ilm.com>
* Use a table for vulnerability section, with a column for the "Affected
Versions" and another for the "Patched Versions".
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
Also, in release.py, convert `text` to ``text`` *before* converting links, so gthe links don't get doubly-converted.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Fix misaligned memory access in `LossyDctDecoder_execute` HALF→FLOAT expansion
After DCT decoding, `LossyDctDecoder_execute()` expands FLOAT-type channels
from their intermediate HALF (16-bit) XDR representation back to FLOAT (32-bit)
XDR in place. The expansion was done by casting `_rows[y]` (a `uint8_t *`)
directly to `float *` and `uint16_t *`, then reading and writing through those
typed pointers.
Because row buffers are assigned by advancing a byte pointer with no alignment
padding (`outBufferEnd += chan->width * chan->bytes_per_element` in
`internal_dwa_compressor.h`), a FLOAT channel that follows a HALF channel of
odd width receives a `_rows[y]` pointer that is 2-byte aligned but not 4-byte
aligned. Dereferencing a `float *` cast from such a pointer is undefined
behavior under the C standard:
- On ARM, RISC-V, and MIPS (strict alignment) this crashes immediately.
- On x86 it is silently tolerated at the hardware level but remains UB:
auto-vectorizing compilers (SSE/AVX) may assume aligned access and generate
incorrect code.
- UBSan reports: `store to misaligned address ... for type 'float', which
requires 4 byte alignment` at `internal_dwa_decoder.h:749`.
Fix: replace the cast-and-dereference pattern with the `unaligned_load16` /
`memcpy` / `unaligned_store32` helpers already used throughout the rest of
OpenEXRCore (`internal_xdr.h`, `unpack.c`, `pack.c`, `internal_pxr24.c`).
These helpers use `memcpy` internally, which the C standard guarantees is safe
for unaligned addresses and which compilers compile to a single load/store
instruction on architectures that support it.
The byte-order handling is preserved correctly:
- `unaligned_load16` reads 2 bytes via `memcpy` and applies `one_to_native16`
(XDR → native), returning a native-endian HALF value.
- `half_to_float` converts native HALF → native float.
- `memcpy(&bits, &f, 4)` reinterprets the float's bit pattern as `uint32_t`
without numeric conversion (the correct type-pun idiom in C).
- `unaligned_store32` applies `one_from_native32` (native → XDR) and writes
4 bytes via `memcpy`, storing the result in XDR float format.
Made-with: Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>
* add TODO comment
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add "cherry" and "changes" options to release.py
Print the SHAs of commits from PRs with the given label:
share/util/release.py cherry v3.4.7
Add section and PR list entry to CHANGES.md:
share/util/release.py changes v3.4.7 2313
These options help automate the release process, although they still
leave theactual cherry-picking to be done by hand.
The release process:
1. Label PRs with the new release label
2. Run "release.py cherry" to print the commits
3. For each PR/commit:
a. cherry pick it onto the release branch
b. run "release.py changes" to add to the release notes
Signed-off-by: Cary Phillips <cary@ilm.com>
* 1. "release.py changes" accepts a list of PRs
2. "release.py cherry" prints a "release.py changes" command for copy/execute.
3. "release.py log" prints a 'git log' with commits annotated with
labels associated with each identified PR.
Signed-off-by: Cary Phillips <cary@ilm.com>
* fix comment
Signed-off-by: Cary Phillips <cary@ilm.com>
* "Workflow" PRs are ones that are either from dependabot *or* only
modify files under .github/workflow
Signed-off-by: Cary Phillips <cary@ilm.com>
* Further clean up the release instructions in CONTRIBUTING.md
And fix a typo in "release.py cherry" output.
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add a message about image size limits and OOM errors
Placed just after the main list of features of the file format, and in
SECURITY.md since misunderstandings of this feature/policy can lead to
false assumptions of security vulnerability.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add reference to setMaxImageSize to ReadingAndWritingImageFiles.rst
And website/src/exrreader/exrreader_max.cpp illustrates setting max
image size.
Signed-off-by: Cary Phillips <cary@ilm.com>
* move exrreader_max to its own directory
Signed-off-by: Cary Phillips <cary@ilm.com>
* mention tiled format/API
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
`numBlocksX` and `numBlocksY` are declared as `int`. Two pointer-offset
expressions in `LossyDctDecoder_execute()` multiplied them as signed
32-bit integers before using the result as a pointer offset:
rowBlock[comp] = rowBlock[comp - 1] + numBlocksX * 64;
currDcComp[comp] = currDcComp[comp - 1] + numBlocksX * numBlocksY;
`dataWindow.max.x` is a signed 32-bit value in the EXR file format, so
`numBlocksX` can reach `(INT32_MAX + 7) / 8 = 268,435,456`. At that
point `numBlocksX * 64 = 17,179,869,184` overflows `int32`, and
`numBlocksX * numBlocksY` overflows even sooner. The wraparound
produces a small or negative pointer offset, causing `rowBlock[comp]`
and `currDcComp[comp]` to point into already-used or pre-buffer memory
rather than the intended component stride.
Fix: cast `numBlocksX` to `size_t` before multiplying so the
arithmetic is performed in pointer-sized unsigned arithmetic:
rowBlock[comp] = rowBlock[comp - 1] + (size_t) numBlocksX * 64;
currDcComp[comp] = currDcComp[comp - 1] + (size_t) numBlocksX * numBlocksY;
This is consistent with the allocation on the line above, which already
uses `(size_t) numComp * (size_t) numBlocksX * 64 * sizeof(uint16_t)`,
and with the packed-DC count check, which uses explicit `uint64_t` casts.
Made-with: Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>
Three classes of signed integer overflow in the PIZ codec path, all
reachable from corrupt `dataWindow` dimensions in the EXR file header.
**`wav_2D_encode` / `wav_2D_decode` — wavelet loop pointer arithmetic**
`oy` is passed as `int` (value `wcount * nx`, at most ~INT32_MAX after
the guard below). Inside the hierarchical wavelet loop the expressions
ey = in + oy * (ny - p2) // pointer end-of-row sentinel
oy1 = oy * p // row stride at level p
oy2 = oy * p2 // row stride at level p2
multiply two values that can each approach INT32_MAX, producing a
signed 32-bit product that wraps to a small or negative value. The
wrapped value is used as a pointer offset, causing reads and writes
through `px` / `py` to land outside the allocated wavelet buffer.
Fix: widen by introducing `int64_t oy64 = oy` and using it for all
three expressions; `oy1` and `oy2` are also declared `int64_t`.
**`wavbuf += nx * ny * wcount` — per-channel buffer advance**
`nx`, `ny`, and `wcount` are all `int`. Their triple product overflows
int32 for moderately large images, causing subsequent channels to be
processed at an incorrect (too-small) offset into the wavelet buffer,
corrupting both encode and decode output.
Fix: cast to `(uint64_t)` before multiplying.
**`wcount * nx` — call-site argument overflow**
The fifth argument to `wav_2D_encode` / `wav_2D_decode` is `wcount * nx`
(`oy` = y-stride = elements per row). `wcount` is 1 or 2
(`bytes_per_element / 2`); for `wcount = 2` the product overflows int32
when `nx > INT32_MAX / 2`.
Fix: add an early bounds check `if (wcount > 0 && nx > INT_MAX / wcount)`
that rejects such input as `EXR_ERR_CORRUPT_CHUNK` before any arithmetic
is performed. This also keeps `wcount * nx` within int32 range at the
call site, ensuring `oy` arrives in the wavelet functions with a valid
non-overflowed value.
Made-with: Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>
In the `EXR_PIXEL_FLOAT` branch of `undo_pxr24_impl()`, the expressions
(uint64_t)(w * 3)
compute the signed 32-bit product `w * 3` before the cast to `uint64_t`.
When `w` is large this is undefined behavior under the C standard; on
two's-complement builds without sanitizers the result wraps to a small
positive value, which can cause the bounds check
if (nDec + (uint64_t)(w * 3) > outSize)
to pass incorrectly. If the check is bypassed the decode loop proceeds
to write `4*w` bytes through `dout`, potentially far beyond the allocated
output buffer.
Fix: cast `w` to `uint64_t` before multiplying so that both the bounds
check and the counter update are performed entirely in 64-bit unsigned
arithmetic:
(uint64_t)w * 3 (cast before multiply, not after)
The `EXR_PIXEL_UINT` and `EXR_PIXEL_HALF` decode branches are unaffected:
they reuse the pre-computed `nBytes` variable, which is already formed as
`(uint64_t)(w) * (uint64_t)(bytes_per_element)`.
Also fix the symmetric issue in `apply_pxr24_impl()` (the encoder):
lastIn += w * 4
advances a pointer by a signed 32-bit product; corrected to
lastIn += (uint64_t)w * 4
Made-with: Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>
Pointer arithmetic involving `srcbuffer` in the `unpack_*` functions
can overflow for very wide images.
Multiplying `int w` by a bytes-per-element constant (2, 4, 6, or 8) in
`srcbuffer +=` expressions causes signed integer overflow when the
image width is large.
Promote the leading operand to `int64_t` at every affected multiplication
so pointer arithmetic is performed in 64-bit signed arithmetic throughout,
eliminating the undefined behavior without imposing any image size limit.
Affected sites: `generic_unpack`, `unpack_16bit`, `unpack_32bit`, and
all 3- and 4-channel interleave/planar specializations.
Made-with: Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>
* PXR24: reject zlib output that does not match packed payload size
PXR24 stores zlib-compressed packed channel data (e.g. 3 bytes/sample
for float), while chunk `unpacked_size` is the native layout (4
bytes/sample). After inflate, validate the decompressed length
against the packed byte count derived from the same geometry as
encode/decode, not `unpacked_size`.
A truncated-but-valid zlib stream previously produced success with a
short `actual_out` while the decoder advanced through scratch as if
the full packed block were present, reading uninitialized heap into
pixels.
Add `pxr24_packed_zlib_size()` (aligned with `apply_pxr24_impl`) and
require `outSize ==` that value after `exr_uncompress_buffer()`
succeeds.
Analysis and solution with the the help of Cursor / Claude Opus 4.5
Signed-off-by: Cary Phillips <cary@ilm.com>
* replace comparison to uncompressed_size with outSize
A simpler solution: remove `pxr24_packed_zlib_size()` entirely detect
corrupt chunks by comparing against `outSize` instead of
`uncompressed_size`.
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
On GitHub’s macOS runners, clang on PATH often points to Homebrew’s
LLVM (e.g. /usr/local/opt/llvm@18/bin/clang) instead of Xcode’s clang.
That LLVM build pulls in Homebrew’s libunwind, which is built with
minimum macOS 14.0. When the OpenEXR extension is built with that
toolchain, it ends up depending on that libunwind.
During wheel repair, delocate copies all non-system dependencies into
the wheel. It then checks that each bundled library’s minimum macOS
version matches the wheel’s target. Homebrew’s libunwind requires
14.0, so if the wheel claims 11.0 (or 10.15), delocate fails.
Xcode’s clang lives at /usr/bin/clang and uses the system C++ runtime
and unwinder. Those are part of macOS and don’t bring in a separate
libunwind dylib with a higher minimum version.
Assisted-with: Cursor / Claude Opus 4.5
Signed-off-by: Cary Phillips <cary@ilm.com>
- ci_steps: set top-level permissions to read, and write only for the
upload step
- release-sign: repository-projects permission is not necessary
- codeql: set top-level permissions to read
Signed-off-by: Cary Phillips <cary@ilm.com>
Only allocate INT32_MAX+2 bytes when sizeof(size_t) >= 8 (64-bit).
On 32-bit MinGW the max object size is INT_MAX, so skip the
oversized-string rejection test to avoid the warning.
Note that we need to use `__SIZEOF_SIZE_T__` to suppress the MinGW warning, since it happens at compiletime, not runtime.
Made with the help of Cursor / Claude Opus 4.5
Signed-off-by: Cary Phillips <cary@ilm.com>
The B44 and B44A decoder and encoder use channel width (`nx`) and
height (`ny`) in row pointer math. `nx` and `ny` are `int`; the
scratch buffer is correctly sized with `(uint64_t)ny * (uint64_t)nx *
bytes_per_element`, but row bases were computed as:
```
row0 = (uint16_t*)scratch;
row0 += y * nx; // int * int -> signed overflow when y*nx > INT_MAX
```
For large `nx` (e.g. 268435456), `y*nx` overflows, so `row0`/`row1`/`row2`/`row3`
point before the scratch buffer.
Fix: compute the row offset in `uint64_t` before pointer arithmetic in both
`uncompress_b44_impl` (decoder) and `compress_b44_impl` (encoder).
Analysis and solution with the help of Curor / Claude Opus 4.5
Signed-off-by: Cary Phillips <cary@ilm.com>
Address issue [2296](https://github.com/AcademySoftwareFoundation/openexr/issues/2296):
weekly analysis_workflow.yml build was broken by the need for libopenjph, which is
not included as a pre-built dependency in the `aswf/ci-openexr:2024` images, which
expect to be used to build OpenEXR 3.2.x.
Switching to the 2026 images allows the build to complete. Also no need to get rid
of GLEW, that issue is no longer relevant in recent images.
Signed-off-by: Jean-Francois Panisset <panisset@gmail.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
* Suppress deprecation warnings for isOptimizationEanbled and standard attributes
The methods are deprecated for use in application code, but no reason
to pollute the build with warnings about the remaining internal usage.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Remove testOptimized.cpp/h entirely.
The test only validates the deprecated API, so it serves no purpose.
This also marks the `InputPart::isOptimizationEnabled()` as
deprecated, since all that does is call
`InputFile::isOptimizationEnabled()`.
Signed-off-by: Cary Phillips <cary@ilm.com>
* remove isOptimizationEnabled() and counts from testInterleavePatterns()
This leaves test test in place since it validates interleave/unpack
coverage, but it removes the use of the deprecated API.
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
Skip GCC visibility (default/hidden) when _WIN32 is defined so MinGW
and msys2 builds use empty export macros and avoid 'visibility attribute
not supported in this configuration; ignored'.
Made-with: Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>
* Fix build failure with glibc 2.43 due to C11 threads.h conflicts
Fix conflicting once_flag, ONCE_FLAG_INIT, and call_once definitions
when building with glibc 2.43, which now includes C11 <threads.h>
support
Detect <threads.h> availability and use standard C11 thread primitives
when present, falling back to pthread or Windows implementations
otherwise CI
This also adds a new Linux build (#12) using a Fedora Rawhide container to
test against glibc 2.43
Signed-off-by: Cary Phillips <cary@ilm.com>
* revert unnecessary stylistic changes
Signed-off-by: Cary Phillips <cary@ilm.com>
* simply internal_thread.h #if logic
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add #if specific to __APPLE__; add better comments
Signed-off-by: Cary Phillips <cary@ilm.com>
* replace __APPLE__ with has_include<threads.h>
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
It uses the insecure pull_request_target trigger, and the better
approach is use the GitHub App's "Show build overview in comment".
Signed-off-by: Cary Phillips <cary@ilm.com>
* release notes and news for 3.4.6, 3.3.8, and 3.2.6
Signed-off-by: Cary Phillips <cary@ilm.com>
remove glibc 2.43 fix from 3.4.6 notes
Signed-off-by: Cary Phillips <cary@ilm.com>
* Fix broken markdown-to-rst link conversion, and subsitute backquotes
The regular expression for link conversion needs to allow newlines in
the text.
Also, convert markdown's single-backquote to rst double-backquote
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
This localizes the oss-fuzz building logic inside the OpenEXR project,
minimizing the changes we have to request of the oss-fuzz project
itself.
Signed-off-by: Cary Phillips <cary@ilm.com>
The doc was written when we planned the vendored OpenJPH to be
released in v3.4.4, but we released v3.4.5 without it. This fixes the
doc to indicate 3.4.6 instead.
Signed-off-by: Cary Phillips <cary@ilm.com>
Release the GIL around OpenEXR read/write operations to allow other
Python threads to run during file I/O. This prevents the bindings
from blocking the entire Python interpreter during potentially
lengthy operations.
Operations wrapped with gil_scoped_release:
- readPixels, readTiles, readPixelSampleCounts
- writePixels, writeTiles, writeTile
- copyPixels
Also adds a test to verify the GIL is released during I/O.
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The USE_F16C_INTRINSICS macro was incorrectly defined when __AVX__ was
set with either __GNUC__ or __clang__, even when __F16C__ was not
defined. This caused build failures on CPUs that have AVX but not F16C
(e.g., Sandy Bridge).
Fix by requiring __F16C__ to be defined (via AND) rather than being
optional (via OR).
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
On 32-bit x86 (i386/i686), the build assumes SSE2 is available at
runtime but doesn't enable SSE2 code generation at compile time.
This mismatch causes testCPUIdent and testDWATable to fail because
the compiled code doesn't match the CPU capability detection.
Add -msse2 and -mfpmath=sse compiler flags for 32-bit x86 builds
(excluding MSVC which handles this differently). This aligns the
compiled code with the runtime expectations.
Fixes#2257
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The ZipCompressor constructor was assigning the compression type
incorrectly. THe logic between ZIP and ZIPS was reversed.
This also adds an inline function to the Compressor class to return
the compressor type.
This also adds a test to validate the Compressor object settings.
Fixes#2255 "ImfZipCompressor maps ZIP/ZIPS to the wrong OpenEXRCore
compression type (ZIP vs ZIPS swapped)"
This also revealed that the DWA and HTJ2K compressor objects set the
compression type to LAST_TYPE, for some reason. Is that an oversight?
Signed-off-by: Cary Phillips <cary@ilm.com>
* validate arguments to exrstdattr
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* add test for exrstdattr argument verification
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
---------
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Co-authored-by: Cary Phillips <cary@ilm.com>
* add python support for OpaqueAttributes
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* add attribute of unknown type to test.exr
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* remove intermediate class; just wrap Imf::OpaqueAttribute directly
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
---------
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Co-authored-by: Cary Phillips <cary@ilm.com>
* Rename OpenJPH/src/core/common to openjph, instead of using a symlink
OpenJPH headers are included in application code with the openjph subdirectory:
However, in the OpenJPH source tree, the headers live under a
directory called "common", which means when OpenEXR builds the
vendored copy of OpenJPH via `add_subdirectory`, the headers aren't in
the expected "openjph" directory.
The previous solution to this was to create a symlink from "openjph"
to "common", but symlinks are fragile on Windows. If the git repo is
cloned with `core.symlinks=false`, the symlink doesn't exist.
This solution simply renames the "common" directory to "openjph" in
the vendored OpenJPH code, adjusting references to it as necessary.
The `vendor_openjph.sh` script does the proper renaming in the OpenJPH
cmake configuration.
This address the issue raised on #2193 after it was merged.
Signed-off-by: Cary Phillips <cary@ilm.com>
* check if "common" has already been renamed to "openjph"
recent releases of OpenJPH have the subdirectory named "openjph", not "common".
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* IlmThread: avoid deprecated atomic_* overloads for shared_ptr
Signed-off-by: tylermorganwall <tylermw@gmail.com>
Use std::atomic<std::shared_ptr<T>> when available to avoid
deprecated atomic_load/atomic_exchange overloads.
Refs AcademySoftwareFoundation/openexr#1786
* IlmThread: make ThreadPool provider move atomic and simplify feature guards
Define `ILMTHREAD_HAVE_ATOMIC_SHARED_PTR` once and reuse it throughout
`IlmThreadPool.cpp` instead of repeating the feature-test expression.
For the atomic `shared_ptr` path, switch `ThreadPool::Data` move
construction from load+store+clear to a single `exchange`, so ownership
transfer is done atomically in one step.
Non-atomic code paths are unchanged.
Signed-off-by: tylermorganwall <tylermw@gmail.com>
---------
Signed-off-by: tylermorganwall <tylermw@gmail.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
* Fix links and formatting in CONTRIBUTING.md
Updated links and corrected text formatting in the CONTRIBUTING.md file.
Signed-off-by: John Mertic <jmertic@linuxfoundation.org>
* Update CLA signing instructions in CONTRIBUTING.md
Clarify the process for signing the Contributor License Agreement (CLA) and provide updated links.
Signed-off-by: John Mertic <jmertic@linuxfoundation.org>
* Fix grammar in CLA information
Correct grammatical errors in the CLA section.
Signed-off-by: John Mertic <jmertic@linuxfoundation.org>
---------
Signed-off-by: John Mertic <jmertic@linuxfoundation.org>
* Vendor in an internal version of OpenJPH
This follows the pattern of `libdeflate`: if an external OpenJPH
installation is found, it will use that, but if none is found, it uses
the vendored code. The CMake configuration
`OPENEXR_FORCE_INTERNAL_OPENJPH=ON` forces use of the vendored
version.
The script `share/util/vendor_openjph.sh` downloads a release of
OpenJPH and adds the necessary files to the repo via git, in the
directory external/OpenJPH. It also modifies the OpenJPH config to
force a static build, so the OpenEXRCore doesn't have to.
The OpenEXRCore CMakeLists.txt adds the vendored code via
`add_subdirectory(... EXCLUDE_FROM_ALL)`, with symbols hidden.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update external/OpenJPH/src/core/coding/ojph_block_decoder_avx2.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update external/OpenJPH/src/core/coding/ojph_block_decoder_ssse3.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update external/OpenJPH/src/core/coding/ojph_block_decoder64.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update external/OpenJPH/src/core/coding/ojph_block_decoder64.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add option to compile c++ libraries with an embedded core library
Can configure with cmake -DOPENEXR_FORCE_EMBEDDED_CORE=ON
This will force symbols to be hidden in the Core library such that when
linked into the c++ shared library or other binary, they will be hidden
(as if there is no core library). This should not be the default config
but is supported for creating custom versions of exr.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Fix bazel build
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
---------
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
The CMake setup is always defining ILMTHREAD_THREADING_ENABLED
macro, just to either 1 or 0 value, so checking for it via #ifdef
will always pass. The non-Core parts of the library were already
using correct checks.
Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>
Co-authored-by: Cary Phillips <cary@ilm.com>
All other Core code uses internal_coding.h functions
half_to_float & float_to_half, in order to make it compile
when IMath is not present at all, follow the same pattern.
This dependency was accidentally introduced in #2174 and #2126
Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>
Results of the latest Linux Foundation license scan.
Several helper scripts need to be updated as well to properly ignore
comment lines.
Signed-off-by: Cary Phillips <cary@ilm.com>
The copywrite notices should appear in the files but not on the
website pages, so the `.. literalinclude::` blocks need a ` lines: 5-`
so it skips the 5 lines of the copywrite notice and renders only the
following lines.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Move thread-safe single initialization utilities into internal_thread.h
Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>
* DWA: initialize linear/nonlinear tables at runtime
DWA compression has two lookup tables for nonlinear value encoding,
each 128KB size. Initialize these tables once upon
first use of DWA compression, instead of spending 256KB if binary
size on them.
The initialization itself takes 0.47ms (Mac M4 Max).
OpenEXRCore-4_0.dylib size goes 628KB -> 370KB.
The previously used precalculated table (dwaLookups.h) still stays
in the repository, but it got moved into the tests only folder,
and the tests were changed to ensure that runtime-initialized
tables match the previous hardcoded table exactly.
Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>
---------
Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>
Co-authored-by: Cary Phillips <cary@ilm.com>
The OpenEXR module is installed into a subdirectory named OpenEXR. Importing via:
import OpenEXR.OpenEXR as OpenEXR
should work but was failing because the module name is different from
what the code was expecting.g
Signed-off-by: Cary Phillips <cary@ilm.com>
* Assert statements are converted to cause a failure in internal_ht.cpp
Signed-off-by: Aous Naman <aous@unsw.edu.au>
* Removed two throws; the third is caught in a try-catch block
Signed-off-by: Aous Naman <aous@unsw.edu.au>
---------
Signed-off-by: Aous Naman <aous@unsw.edu.au>
Co-authored-by: Cary Phillips <cary@ilm.com>
* B44: initialize exp/log tables at runtime
B44 compression is probably very rarely used, and even when it is, the
tables are only ever used on channels marked as "linear"
(EXR_PERCEPTUALLY_LINEAR), which is not the default.
Instead of having a megabyte of source code for the tables, that take
up 256 kilobytes of library size, initialize the tables once upon
first use of B44 compression. The initialization itself takes under
a millisecond (Ryzen 5950X, Windows, build without F16C enabled even),
and is done in a thread-safe way using InitOnceExecuteOnce / pthread_once
depending on the platform.
OpenEXRCore-4_0.dll size goes 868KB -> 614KB.
Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>
* Trying to fix static builds
Symbol visibility is slightly different once a C file contains
not only data, but also a function. So the tables and their
initialization need to be split into separate source files.
Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>
* Fix threads=off build
The ILMTHREAD_THREADING_ENABLED is defined to 0 or 1! Which means
some already existing code within the whole library is already
wrong
Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>
---------
Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>
Co-authored-by: Cary Phillips <cary@ilm.com>
The `PyObject_StealAttrString` function called
`PyObject_GetAttrString` to get a new reference, then immediately
decrefs it and returns the pointer, which subsequent code uses,
leading to a use-after-free.
This rewrites all code that used that construct, primarily
`makeOutputFile`.
Signed-off-by: Cary Phillips <cary@ilm.com>
This is an ancient utility function that at one point served as a
debugging aide, a symbol to set a breakpoint for in the debugger. It's
problematic because it's not namespaced so it can lead to symbol
collisions when linking multiple versions of the library into a single
binary.
This is an API change, so it should only go into the next major release.
Signed-off-by: Cary Phillips <cary@ilm.com>
This makes it possible to set CMAKE_DEBUG_POSTFIX="", which wasn't
possible before but is desirable in the case where the debug libraries
should have the same name as the release build.
Signed-off-by: Cary Phillips <cary@ilm.com>
* remove unused variable
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* allow a single line when positions are negative with large y sampling > height
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
---------
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Fix bug with re-reading scanline file with a different set of channels
Fixes#2141.
The `first` flag in the `ScanLineProcess` object should be reset to
false in `ScanLineInputFile::setFrameBuffer()`, so subsequent calls to
`readPixels()` do the proper initialization.
Also adds a test, which fails without the fix in
`ScanLineInputFile::setFrameBuffer()`.
Signed-off-by: Cary Phillips <cary@ilm.com>
* replace first=true with singleScan.reset()
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* Fix handling of corrupt RLE data
If the size of the uncompressed RLE data does not match the expected
output size, the chunk is corrupt, so report an error.
Signed-off-by: Cary Phillips <cary@ilm.com>
* remove packsz>0 because of the packsize==0 above
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
This is a helper script that runs the gh cli to create draft releases,
update news items, and format message.
Signed-off-by: Cary Phillips <cary@ilm.com>
CMake's `file(CREATE_LINK ... SYMBOLIC)` function can fail in some
cases, notably on Windows which seems to require that developer mode be
enabled in order to create symbolic links. It can return a status code
though which can be checked to determine whether the symlink was created
successfully or not, so if it reports that it failed we can fallback to
a regular COPY. CREATE_LINK does have a COPY_ON_ERROR option, but that
is only intended for individual files and will not copy an entire
directory's contents, which is what is needed in this case.
Signed-off-by: Matt Johnson <matt.johnson@epicgames.com>
Something seems to have gotten more sensitive. Readthedocs has
processed this fine, but building locally now reports several
problems:
* Doxgen argument mismatch in src/lib/OpenEXRCore/internal_ht.cpp: size vs sz
* SPHINX_CONF_PY_FILE was undefined, leading to an empty
MAIN_DEPENDENCY for the sphinx-build command, silently ignored
before.
* Missing backquote in website/install.rst
* Duplicate hyperlinks named `here` in website/news.rst
* A problem with subheader delimiters in website/news.rst
Signed-off-by: Cary Phillips <cary@ilm.com>
Downloading from ftp.gnu.org has been timing out, and it turns
out it's known to be slow. https://mirror.cs.odu.edu is apparently
more reliable.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Fix openjph include directory
This fixes the openjph includes to look in the openjph folder:
This worked in earlier releases because OpenJPH 0.22 and before
appended openjph to the INTERFACE_INCLUDE_DIRECTORIES in its exported
cmake config, but this is fixed in OpenJPH 0.23.
Rather than complicate the OpenEXR source files, this fixes the
problem in the cmake config for the earlier versions by manually
stripping the "openjph" from the include directory setting.
However, when building OpenJPH via FetchContent, the headers reside in
src/core/common directory in the OpenJPH source tree, not in an
openjph folder, so this creates a symlink in the openjph source folder
in this case. Note that the longer (hopefully not too much longer)
term plan is to vendor in the openjph source and dispense with the
FetchContent altogether, so this code can be removed then.
I've tested this with OpenJPH 0.22.0, 0.23.1, and 0.24.1 in both the
case of fetch/internal build and building against an external
installation.
Signed-off-by: Cary Phillips <cary@ilm.com>
* bazel: bump openjph to 0.24.1
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
Cosmetic change, no change in functionality.
Remove the trailing spaces in comments in `CMakeLists.txt`
Signed-off-by: Reinhold Gschweicher <pyro4hell@gmail.com>
The RB-3.4 branch has been made, so the version on the main branch
should go up. The version on the main branch should be the *next*
release, after the upcoming v3.4 release.
Signed-off-by: Cary Phillips <cary@ilm.com>
And update the references to v3.4 upon release.
Plus, a few updates to the news.rst file and the release.py script
that generates the news item from the release notes.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Remove openjph from OpenEXR.pc
It's not a part of the public interface, so it's not necessary for
application.
Also, since src/lib/OpenEXRCore/CMakeLists.txt declares OpenJPH as
private:
target_link_libraries(OpenEXRCore PRIVATE ${EXR_OPENJPH_LIB})
it is *not* necessary in the `target_link_libraries(PUBLIC)`
declaration in cmake/LibraryDefine.cmake, so this change removes it
there.
This also adds a ci test to validate the OpenEXR.pc.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add EXR_OPENJPH_PKGCONFIG_REQUIRES to Requires.private
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add -static to validate_pkgconfig.sh for static builds
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
These appear to have been left in ImfHTCompressor.h inadvertently from
an earlier implementation:
#include <ojph_codestream.h>
#include <ojph_file.h>
They aren't necessary, and they inject an unnecessary compile-time
dependence on the openjph headers.
Signed-off-by: Cary Phillips <cary@ilm.com>
When `OpenEXR.File` opens a file, it now holds onto the
`MultiPartInputFile` object (deleted by the destructor when the `File`
goes out of scope), so that a subsequent `write` operation can call
`copyPixels` on it to transfer the image data from the input to the
new output file.
A new test in `src/wrappers/python/test/test_unittest.py` validates
the behavior with a muli-part file.
Signed-off-by: Cary Phillips <cary@ilm.com>
Files with a single part allow the part name to be empty. Part names
are only required if there is more than one part.
Addresses #2089.
Signed-off-by: Cary Phillips <cary@ilm.com>
Replace old function names in the C API docs:
exr_read_scanline_block_info() → exr_read_scanline_chunk_info()
exr_read_tile_block_info() → exr_read_tile_chunk_info()
Signed-off-by: Benedikt Krengel <74617304+benekreng@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
This adds a test in `src/test/subdirectory` that builds the
`exrwriter` example program with a CMake configuration that references
openexr via:
add_subdirectory(openexr)
Note that the existing website example program uses
find_package(openexr). This compiles the same program (via a symlink
to the source), but with a different CMakeLists.txt. The `openexr`
submodule in the test directory is simply a symlink to the top-level
repo.
This change also introduces an option to specify the cmake version for
each job, and adds tests for cmake 3.14.7 and 4.0.3.
NOTE: This behavior currently does not work with cmake 3.26+, so the
"cmake 4" CI job fails, but the fix is in PR #2087 (Fix aliases for
IexConfig and IlmThreadConfig).
Also, this changes the example `README.md`/`exrwriter.cpp` code to use
the `OPENEXR_IMF_NAMESPACE` rather than a hard-coded `Imf`, so we now
validate the behavior of specifying an explicit alternative namespace
for downstream applications.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add CI jobs for C++20, and build tools/tests against standard
The `OPENEXR_CXX_STANDARD` was not getting set for the bin tools and
tests, which it should, to ensure the entire suite builds in the given
environment. This consolidates the logic for building the bin tools
into a function in the src/bin/CMakeLists.txt file.
Also, the minimum CXX version was being silently bumped up to 17,
which seems wrong. If you specified c++11 or c++14 for some reason, it
should do what you say and fail. The code still builds for 11 and 14,
since we haven't yet introduced any features that require 17+, even
though we state 17 as the project minimum.
The C++20 CI jobs build the library and tests but don't *execute* the
tests, just to save execution cycles.
TODO: We should make a larger refactor of the CI to run a more
exhaustive combination of compiler/system/configuration options on
release candidates, and leave a short list of the most-likely-to-fail
tests to run on each PR. But that's for a separate PR.
Also, it looks like the OPENEXR_INSTALL options were duplicated
between `OpenEXRSetup.cmake` and the root `CMakeLists.txt`, so this
cleans that up as well.
Signed-off-by: Cary Phillips <cary@ilm.com>
* remove blank lines
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
These have been incorrectly specified from the project's earliest
cmake configuration as:
add_library(${PROJECT_NAME}::Config ALIAS IexConfig)
add_library(${PROJECT_NAME}::Config ALIAS IlmThreadConfig)
but these conflict with:
add_library(${PROJECT_NAME}::Config ALIAS OpenEXRConfig)
Each duplicating a declaration of OpenEXR::Config. These have likely
never been used. This changes updates them to what was likely original
intention:
add_library(Iex::Config ALIAS IexConfig)
add_library(IlmThread::Config ALIAS IlmThreadConfig)
CMake prior to 3.26 didn't complain, but 3.26+ has new aliasing
features which encounter the problem when OpenEXR is configured in an
application via `add_subdirectory(openexr)`.
Signed-off-by: Cary Phillips <cary@ilm.com>
Rather than explicitly stating each step's working directory, use use
BUILD_DIR and INSTALL_DIR env vars. It's easier to follow this way.
Also, Windows requires explicitly setting the PATH before running
ctest and before executing the website example. Set OPENEXR_PATH to
have the necessary components. Because the PATH can get modified
internally by GitHub actions, it's easiest to gather the path setting
into a variable and set it explicitly just before execution.
This also renames the "ubuntu" install manifests to "linux".
Signed-off-by: Cary Phillips <cary@ilm.com>
* release.py notes <tag> - extract release notes from CHANGES.md for the tagged release, print to stdout
* release.py news <tag> - edit the website/news.rst file to add reference to the tagged release
* release.py draft <tag> - create a draft release on GitHub
* release.py candidate <tag> - format a message about the upcoming release, print to stdout
Signed-off-by: Cary Phillips <cary@ilm.com>
The Deep Scanline Input file read with an externally provided framebuffer was
leaking lots of memory. The reason was the Scanline process, which has a
boolean member variable check in its destructor that controls whether the
member buffers will be freed or not.
However this boolean member variable was never set in the code path that uses
an externally provided framebuffer, making Deep reading leaking massive amounts
of memory.
This commit fixes the memory leak issue, but setting the member variable after
the decoding initialisation.
Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>
This makes a better "hello, world" example writer program, creating a
non-square image to differentiate between x and y, and also provides a
visual example of what the resulting image looks like: a 100x50 image
with horizontal stripes 5 pixels high.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Fix problem with OpenJPH downstream dependency
The dependency on OpenJPH was not properly propogated to downstream
projects, so applications building against an installation of OpenEXR
that was in turn build against an external installation of OpenJPH
would fail to find openjph. Linux is forgiving, but macOS and Windows
would fail.
There necessary `target_link_libraries()` and `find_dependency()` were missing.
This also cleans up the configuration "find" and "fetching" status
messages and makes them consistent across Imath, libdeflate, and
OpenJPH.
This also renames `OPENEXR_OJPH_REPO' to `OPENEXR_OPENJPH_REPO' and
`OPENEXR_OJPH_TAG' to `OPENEXR_OPENJPH_TAG', for consistency.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add comments to the install scripts
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
Universal2 builds with CMAKE_OSX_ARCHITECTURES=x8664;arm64.
OpenJPH failed with this until 0.21,3
Technically, the cibuildwheel action does this but failure messages there
are harder to parse, so better to treat it as a first-class CI check.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Refactor UNPACK_SAMPLES macro to allow code reuse.
Breaking each case of the UNPACK_SAMPLES macro into seperate smaller macros
that can be reused to avoid code duplication.
Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>
* Refactor some common code out in a macro
Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>
* Optimise EXRCore Deep pixel unpacking
The functions for doing Deep pixel unpacking, had two branch checks (switch
statements) for checking the pixel and requested data type within the inner
most loop that goes over the pixels of each line. This is definitely
unnecessary, since the data types remain the same. However the compiler
is not able to optimise this, and the generated assembly for the pixel
for loop is massive since it contains all these branch checks.
This commit fixes this issue by moving the two switch statements outside
of the pixel for loop, which makes the compiler able to generate much more
efficient assembly for the pixel unpacking operations.
Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>
---------
Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
* Fix Deep Scanline Input crash when using an externally allocated framebuffer
The Deep Scanline Input code has recently been rewritten to make use of the
EXR core library. As a result a bug was introduced when using the overloads of
readPixels() and readPixelSampleCounts() that use externally provided
framebuffers as parameters, a hard crash was occuring. According to the comment
on the header of these functions, when these overloads are used the InputFile's
frameBuffer is not used.
However both these functions call into readMemData(), which does use the
InputFile's member framebuffer, which has not been allocated, resulting into a
segmentation fault.
This commit fixes the above issue, by using the parameter framebuffer that is
passed in, which should be allocated by the caller application.
Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>
* Add a Deep Scanline Input test that uses a framebuffer parameter
After having found a bug with the readPixels() and readPixelSampleCounts()
overloads that receive a framebuffer parameter, it was made apparent that there
was a hole in our tests to cover these functions.
This commits slightly refactors the DeepScanLineBasic tests and adds a third
read path to add coverage for this case as well.
Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>
---------
Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>
This renames the new compression to "htj2k". The discussion on this
concluded that the most significant aspect of the code is the "j2k"
part. The "256" part indicates the number of scanlines per chunk, but
should that should be regarded as the implicit default. Should we ever
introduce a j2k codec with a different scanline count, we can include
that non-default number in the name then.
From the htj2k-beta branch, this renames:
* "ht256" as a compression string name to "htj2k"
* HT256_COMPRESSION to HTJ2K_COMPRESSION
* EXR_COMPRESSION_HT256 to EXR_COMPRESSION_HTJ2K
NOTE: existing files written by applications build against the
htj2k-beta branch will not be readible by applications built with the
library going forward!
Signed-off-by: Cary Phillips <cary@ilm.com>
It appears ninja is not supported.
Also, fix test_build.sh; SRC is the parent of openexr, not the repo
itself. And add diagnostic output to cmake as well.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Improve reliability and readability of bin tests scripts and failure output
The src/test/bin tests have been failing intermittently in the CI
checks, and the problem appears to be known instability in CMake's
file(DOWNLOAD) when invoked from processes in GitHub actions. The
downloaded files occasionally have 0 size.
This change brings the test images into the git repo rather than
downloading them from
https://github.com/AcademySoftwareFoundation/openexr-images at
configure time. I did that way originally to avoid repo bloat, so I
trimmed the list of files used by the tests, so the additional data is
not that signifiant, a few Mb.
This also restructures the test scripts to produce more informative
output, and restructures the CI steps to make it easier to navigate
the logs.
Signed-off-by: Cary Phillips <cary@ilm.com>
* put bin test images in dict; label tests with OpenEXR.bin
Signed-off-by: Cary Phillips <cary@ilm.com>
* typo
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* Enable vectorisation for ZIP reconstruct stage on Windows
The __SSE4_1__ macro that is used to control the use of the vectorised version
of the reconstruct() function, is only defined for GCC and clang. As a result,
Windows were using the scalar version, which is less performant.
This commit fixes the above issue by adding a check for MSVC, similar to what
we have on the SSE2 macro check (and in other places in the code base).
Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>
* Applying simple const correctness to internal_zip
Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>
---------
Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
* Using CMake to build oss-fuzzers
The oss-fuzz build script
https://github.com/google/oss-fuzz/blob/master/projects/openexr/build.sh
currently had hard-coded compile/link commands with explicit
references to libraries and include directories. This requires
updating when anything about the link process changes, i.e. we add
OpenJPH. Better to just use CMake to build the fuzzer binaries.
In a separate PR to the OpenEXR oss-fuzz project, I'll update the
build.sh to simply build via CMake and provide the LIB_FUZZING_ENGINE
as a cmake command-line option. This only builds the fuzzers if
OPENEXR_OSS_FUZZ_LIB_FUZZNG_ENGINE is set.
Signed-off-by: Cary Phillips <cary@ilm.com>
* add ozz_fuzz target and install component, and move oss-fuzz to src/test
Signed-off-by: Cary Phillips <cary@ilm.com>
* add test_build.sh, and a symlink for the current build.sh
Signed-off-by: Cary Phillips <cary@ilm.com>
* use CMakePresets.json for oss_fuzz options
Signed-off-by: Cary Phillips <cary@ilm.com>
* typo
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* Fix crash in exrmetrics when running in single part mode.
Signed-off-by: Vlad Lazar <vlazar@ilm.com>
* Add a python test
Signed-off-by: Vlad Lazar <vlazar@ilm.com>
---------
Signed-off-by: Vlad Lazar <vlazar@ilm.com>
* Allow partial reconstruction of the chunk table to succeed
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Update implementation to only update fixed entries
When a partial reconstruction happens, only update the fixed entries. If
it is a complete reconstruction, can copy full array blindly.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
---------
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
These flags are now specified via a generator expression, so they are
only applied to C++ compilation, not CUDA.
This also makes the flags PRIVATE, not PUBLIC. They should not affect
dependant projects, so they should not be a part of the public
interface.
Resolves#2018
Signed-off-by: Cary Phillips <cary@ilm.com>
* fix minor compile warnings
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* update mingw toolchain example
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* refactor compile ifdefs to work with i686 and no sse
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* force sse2 and re-enable testing for mingw32
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
---------
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Add MSYS2 jobs to CI
Build with MINGW32 and UCRT64, both shared and static.
The MINGW32 build will fail until PR 2013 is merged.
This is not quite complete, because even with PR #2013,
OpenEXRCore.testDWATable fails under MINGW32. In that case, the test
step is et to continue-on-error until this can be resolved.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Install cc, cmake, imath, and libdeflate via pacboy
Signed-off-by: Cary Phillips <cary@ilm.com>
* Install imath/libdeflate via pacboy only if not forcing internal build
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
- Remove explicit CIBW_ARCHS_LINUX from wheel publishing
workflows. Before the addition of the arm build, these simply stated
the default so the weren't necessary, but on arm they're incorrect.
- Fix the names of the download artifacts, and add missing steps for
the arm builds.
- Explicitly set MACOSX_DEPLOYMENT_TARGET. It's set in pyproject.toml,
but that seems to not be sufficient.
Signed-off-by: Cary Phillips <cary@ilm.com>
These apparently got overlooked when originally committing these
install manifests, and the test didn't fail because the numbers happen
to match as is, but that won't be the case going forward.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Fix issue with atomic_compare_exchange_strong due to inappropriate type on 32 bit platforms
Signed-off-by: Christopher Schwartz <christopherschwartz@xrite.com>
* Change casted type to match the type of the assigned to variable on both, 32 and 64 bit platforms
Signed-off-by: Christopher Schwartz <christopherschwartz@xrite.com>
---------
Signed-off-by: Christopher Schwartz <christopherschwartz@xrite.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
* check string size when looking at the type
If corrupt files put nul or other non-printing characters in the string
data it can be difficult to debug when the type name is printed but does
not compare equal.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* remove duplicate max sizes
use the size defaults in the core library
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* add check when in reduceMemory ahead of sample count alloc
when there are large tiles, need to check the memory prior to allocating
the sample count array. Additionally set a max tile size even when not
in reduce memory, although set larger than any known use for a tile size
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
---------
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
* add an OPENEXR_INSTALL_DEVELOPER_TOOLS option
This new option will control whether or not the tools
considered to be "developer" tools should be installed.
These are tools useful for developing and debugging OpenEXR
itself that might not be suitable for distribution to end
users. exrcheck is currently the only tool considered to be
a developer tool.
Signed-off-by: Matt Johnson <matt.johnson@epicgames.com>
* exrcheck: update CMakeLists.txt to enable developer tool installation
This makes the CMakeLists.txt for exrcheck look like other
tools like exrinfo and uncomments the CMake call to install
the tool. One difference though is that exrcheck is considered
a developer tool, and as such is only installed when the
OPENEXR_INSTALL_DEVELOPER_TOOLS option is enabled.
Signed-off-by: Matt Johnson <matt.johnson@epicgames.com>
---------
Signed-off-by: Matt Johnson <matt.johnson@epicgames.com>
* Adjust the clamping on the dwa compression
The dwa compression is not truly a quality level like other things, so a
maximal value is controlling quantization, not quality. A value of 0 is
allowed, but negative is not.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* improve tests for dwa compression level set
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
---------
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
If we know the file size, we should truncate the header parse to only
read the file at most. Otherwise, if the file size is unknown (stream)
then be conservative (and slower) and read 1 byte at a time for the
header parse. Once we know the file, that should be free to read chunks
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
In SSE, we were incrementing a pointer as if it were a uint16_t, not an
si128, causing out of bounds accesses on non-block aligned chunks.
Similarly, simplify the alignment logic and check return values and
pointers in related accesses (non-block aligned linear lut lookup).
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
If the chunk table is unable to provide the specified data window, do
not allocate the frame buffer (or cache framebuffer) to that size
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
for deep frame buffers, when filling, if the caller does not provide
output memory for a particular sample set, do not crash.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
If the zipped data unpacks to a buffer which is too large, but still
within the scratch buffer size, could potentially write past the end of
the buffer
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
the std::filesystem::path mechanism is reasonable, but needs to be told
it to look for a utf-8 string, and is not automatically that, and the
standards committee must have realized there were issues and change the
api in c++20
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* clean up exrmetrics help, simplify JSON output
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* revert exrmetrics to returncode 0 with --help
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
---------
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* update all upload-artifact usage to v4
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* replicate unique name change
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Update .github/workflows/python-wheels-publish-test.yml
-${{ env.INSTALL_MANIFEST }} should definitely not get appended to the name, that was appropriate only for the install manifests in ci_steps.yml.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update .github/workflows/python-wheels-publish.yml
-${{ env.INSTALL_MANIFEST }} should definitely not get appended to the name, that was appropriate only for the install manifests in ci_steps.yml.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update .github/workflows/ossfuzz_workflow.yml
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update .github/workflows/python-wheels.yml
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update .github/workflows/scorecard.yml
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update .github/workflows/scorecard.yml
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
This requires all artifacts to have unique names, so the
install_manifest.txt files need to uploaded with the name that
includes the os and build number.
Signed-off-by: Cary Phillips <cary@ilm.com>
The libdeflate and Imath installation steps require bash, not
PowerShell, otherwise they fail silently and fall back to the auto
fetch/build. And the install manifests for the validation were
correspondingly incorrect.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update security policy regarding backporting patches
This wording captures our policy: we commit to fixes for main and the
most recent minor release, but prior to that, discussed on a
case-by-case basis. Better to leave it at than than attempt to be more
specific, since those specifics can be determined based on the situation.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Support policy for 2.0-2.4:
2.4 was the first release by the ASWF, recent enough to negotiate
patches. Prior to that our knowledge is so limited, and CMake support
was so fragile, that we should not even entertain the possibility.
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
The fast unpack routines for 3 and 4 channels were not designed to
handle sub-sampled images, but need to appear before other fallback
disablement in the choice logic. Until that choice logic can be
simplified, add additional checks to avoid heading to that branch
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
uses likely / unlikely macros to better guide branch predictor,
convert some static / local functions from functions to macros to avoid
having to take the address of a local variable, preventing register
optimizations, and finally guide pointer aliasing to get some
speed improvements in the huf encoder / decoder.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Convert the quantization from a massive table to a bit-fiddling
algorithm which is more code but significantly faster (in some cases,
almost 2x). This also eliminates the giant lookup tables from the
binary, which reduces the compiled size of the core library. Beside
the identity table (value in, same value out), those quantization
tables are preserved in the unit tests to ensure correct behavior.
The tests are defaulted to a light-er weight test, which should test
the variety of error tolerance ranges, but there is a deeper test
that can be enabled by switching an ifdef in the compression tables
test.
As a motivation for improvement, with this change, the size for the
core library is reduced by more than half (2.2MB to 0.99MB) while
performance is improved from 0.23s for an encode to 0.155s on
x86_64 with avx2 / f16c enabled anyway. Other platforms will
hopefully experience similar improvements.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
objectToBox2f was failing to store the value in the proper argument.
Also, the test was never actually creating a box out of floats, it was
only testing integers.
This also fixes an as-yet-undetected error with the use of Imf
namespace in PyOpenEXR_old.cpp, where there's already a `using`
statement.
Signed-off-by: Cary Phillips <cary@ilm.com>
This does NOT change the default thread pool provider if you manually
instantiate a thread pool, as that would change the contract of the
previous definition of the thread pool and likely cause deadlocks when
users expected separate threads in separate thread pools
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* update pyproject.toml and python workflows: Add numpy dependency
- Additional dependencies required for the build environment
Numpy must be installed in the python environment where the build is being performed in order to build.
- Automatic installation of dependencies like a normal python package
When installing this package, if numpy does not exist in the python environment, it will be installed automatically.
Signed-off-by: HyeongSeok Kim <tiryul@gmail.com>
* update python-wheels-*yml, pyproject.toml: remove BEFORE_BUILD, remove numpy in build requires
- python-wheels-*yml: When testing on other PRs, I found that dependencies were not properly installed for each build case, so I added this code. However, this PR is for adding numpy dependencies, so it is not needed as @JeanChristopheMorinPerso suggested.
- pyproject.toml: If you are going to do any additional work with the build artifacts, like generating stubs, you will need numpy in your build environment, but it is not needed at the moment. I agree with the review by @JeanChristopheMorinPerso.
Signed-off-by: HyeongSeok Kim <tiryul@gmail.com>
---------
Signed-off-by: HyeongSeok Kim <tiryul@gmail.com>
* Restructure CI to use reusable steps, and add new checks
The goal of this change is to add tests to catch some recent
regressions that the existing CI missed:
* Validate that the proper files get installed. A recent
innocuous-seeming change to the cmake config caused libdeflate files
to make it into the installation and we didn't catch it.
This change introduces a validation step that compares the
install_mantifest.txt file from each job to a reference maintained
in share/ci/install_manifest. Each job has a "build" number that
identifies the reference manifest.
NOTE: This means that all future changes to installed headers and
libraries must be reflected in these manifests.
* Validate building against prebuilt/external Imath and libdeflate
libraries, and also test the "force internal" option.
* Validate building with custom namespaces
To make the workflow files easier to maintain, this splits two parts:
* The ci_steps.yml file declares a common set of steps for Linux,
macOS, and Windows, and a set of variables named to match the
various CMake configuration options.
* The ci_workflow.yml invokes these steps with a succession of builds
that provide collections of CMake settings, which is passes to the
reusable workflow via the "with:" statement. The "with:" statements
provide default variable settings, which means each build specifies
only non-default settings, for a compact summary of what's unique
about that job.
Some notes:
* By default, the builds now pre-install Imath and libdeflate, so that
the main OpenEXR build picks them up. A special build now validates
the behavior of OPENEXR_FORCE_INTERNAL_IMATH and
OPENEXR_FORCE_INTERNAL_DEFLATE, which were previously untested.
* For each OS, we now build and test these configurations:
1. Release
2. Debug
3. Static
4. Threading disabled
5. pkgconfig, docs, examples, tools disabled. This was also previously not
tested.
6. Legacy VFX reference platform compiler(s) and/or os(s)
* The "label:" setting forms the description of the job on the GitHub
Acions page, prepended with the OS and "build" number, which makes
it easier to cross reference between the entries on the Actions page
and the workflow file.
* We no longer build with clang on Linux, since we do a clang build on
macOS.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add Linux clang build
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* Workaround CI workflow for vfx 2022/2021
Build for VFX reference platform prior to 2023, which requires a
workaround to run an old version of glibc required by the ASWF Docker
images.
This doesn't easily integrate with the existing CI workflow, and it
can be deprecated entirely once we've moved beyond support for the
old CentOS-based VFX reference platform years.
See this discussion for details:
https://academysoftwarefdn.slack.com/archives/C0169RX7MMK/p1732574400981949
Signed-off-by: Cary Phillips <cary@ilm.com>
* remove centos7 label
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
The CI was failing to actually set OPENEXR_THREADING_ENABLED for the
macOS and Windows builds.
And the Windows build as failing with threading disabled, due to a
missing header.
Signed-off-by: Cary Phillips <cary@ilm.com>
When we implemented the "rule of 5" (PR #601) in 2019, I added code to
testAttributes.cpp to validate the behavior, specifically related to
the TypedAttribute class, but in retrospect, this code isn't reliable,
so I propose eliminating the test altogether.
The test counts invocations of the various constructors, destructors,
and move/assignment operators, expecting them to be consistent, but
compilers can optionally optimize some of these operations away,
producing inconsistent results.
In particular, a Debug build on Windows produces different results
from a Release build. Our CI has not historically tested a Windows
Debug build, which explains why we never caught this. The exact
behavior may have also changed with C++17. All the more reason to
avoid such picky tests.
This does not change the library code, only the tests.
Signed-off-by: Cary Phillips <cary@ilm.com>
To properly support custom namespaces, all namespace references should
use the appropriate macros, not hard-coded literals.
Signed-off-by: Cary Phillips <cary@ilm.com>
* CMake: use lower case name when checking whether Deflate is populated
The documentation for CMake's FetchContent_GetProperties() is not
particularly clear, but it follows the same convention of
FetchContent_Populate() and FetchContent_MakeAvailable() where the
given name is converted to lower case to produce the variable names,
so this changes the test for Deflate population to use the correct
"deflate_POPULATED" variable name.
Signed-off-by: Matt Johnson <matt.johnson@epicgames.com>
* CMake: use EXCLUDE_FROM_ALL when declaring Fetch for deflate library
Commit af9ef0e made a change in the CMake setup to switch from using
FetchContent_Populate() to FetchContent_MakeAvailable() to bring in
libdeflate (and Imath) as dependencies. Using FetchContent_MakeAvailable()
has the side effect that libdeflate is now being included as part of the
build, causing libraries and headers to be built and installed.
The intent with fetching the deflate source is solely to copy select
files into OpenEXRCore, so this change adds the EXCLUDE_FROM_ALL option
to the call to FetchContent_Declare() to prevent deflate from being
included in the build.
One wrinkle though is that prior to CMake 3.28, passing the
EXCLUDE_FROM_ALL option to FetchContent_Declare() does *not* have the
desired effect of excluding the fetched content from the build when
FetchContent_MakeAvailable() is called. Ideally we could "manually"
set the EXCLUDE_FROM_ALL property on the deflate SOURCE_DIR and
BINARY_DIR, but a bug that was only fixed as of CMake 3.20.3 prevents
that from properly excluding the directories:
https://gitlab.kitware.com/cmake/cmake/-/issues/22234
To support the full range of CMake versions without overly complicating
things with cumbersome workarounds, we continue to use Populate for CMake
versions before 3.30, and switch to MakeAvailable for CMake 3.30 and later.
Signed-off-by: Matt Johnson <matt.johnson@epicgames.com>
---------
Signed-off-by: Matt Johnson <matt.johnson@epicgames.com>
Previously we allowed multiple threads to cache but that caused memory
bloat, here, only keep one so successive reads will be faster for
compression types where there are more than one scanline per chunk
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
When providing a custom stream, there is no reason a filename needs to
be provided beyond clearer error messages. Because std::string does not
allow null, continue to disallow a null filename. Add a test case
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Also, remove the `if(INSTALL_DOCS)` conditional in
docs/CMakeLists.txt, since that file is included only if
`OPENEXR_INSTALL_DOCS` is set.
Signed-off-by: Cary Phillips <cary@ilm.com>
Rather than pinning libdeflate to a specific version, we should have
the OpenEXR main branch fetch from libdeflate's master branch, so our
bleeding edge uses their bleeding edge. Then, we pin to the most
recent libdeflate branch on minor release, or patch release if it's
ABI compatible.
Signed-off-by: Cary Phillips <cary@ilm.com>
* news update for v3.3.1
Signed-off-by: Cary Phillips <cary@ilm.com>
* Put lastest news title in website/latest_news_title.rst
So the "Latest News" section on the main page can get the title as
well as the body of the news item, which is pulled from
website/news.rst.
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* Enable fast huf for os/x, optimize routines
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Apply some minor optimizations to piz decode
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* disable alias tag for msvc
It appears MSVC does not handle the restrict keyword properly
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Replicate comment denoting issue w/ msvc
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Remove overzealous memory optimization
It is more efficient to store the code length and symbol in the one
table, but appears measurably slower. Remove that.
Further, do not constantly refill the bit buffer during huf fast decode,
that slows down the decoding
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
---------
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
The cmake docs say:
The FetchContent_Populate() command is a self-contained call which
can be used to perform content population as an isolated
operation. It is rarely the right command to use, projects should
almost always use FetchContent_Declare() and
FetchContent_MakeAvailable() instead.
And the python wheel sdist build reports warnings (macOS 12.7):
CMake Warning (dev) at /private/var/folders/zd/1cs92n8x61j06hj_gbv7qlvr0000gn/T/pip-build-env-t9wrh100/normal/lib/python3.12/site-packages/cmake/data/share/cmake-3.30/Modules/FetchContent.cmake:1953 (message):
Calling FetchContent_Populate(Deflate) is deprecated, call
FetchContent_MakeAvailable(Deflate) instead. Policy CMP0169 can be set to
OLD to allow FetchContent_Populate(Deflate) to be called directly for now,
but the ability to call it with declared details will be removed completely
in a future version.
Signed-off-by: Cary Phillips <cary@ilm.com>
Compiling OpenEXRTest with dependencies from a fresh checkout, in Release
config with VS2022 on Ryzen 5950X: 75sec -> 12sec.
Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>
* always return if all we need are the sample counts
regardless of 0 sample counts or not, return if that is all we need, as
unpack buffers will not have been allocated for data
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* do not allow string lengths larger than the remaining data within the string vector
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* simplify safety check logic
The file size would have already been checked by the attrsz check, so
this check works implicitly, and works when the file size is not
available (streams)
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
---------
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
This enables reading of scanlines in a "stateless" manner, where a
framebuffer does not have to be stored, then the call to readPixels
made.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
All reading code has a (for threaded reads) need to maintain a set of
contexts and re-use them while dispatching N threads. Create a class to
do that and remove duplicate code.
This also lowers the scope of when the contexts are alive to reduce
memory bloat
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
The default behavior of sigstore/gh-action-sigstore-python has
changed. Disable the automatic uploading of signed artifacts, since
this now includes artifacts named with just the tag, without the
"openexr-" prefix.
Also, the signature file now has a .json suffix.
Signed-off-by: Cary Phillips <cary@ilm.com>
Old library allowed names to accumulate, whether that is a great feature
or not, preserve that when not in strict mode.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
There is validation for tile descriptions already when looking at a
tiled file, but if someone provides a tile description in a non-tiled
file, validate that the enums will be valid
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Add validation that the types of the attributes are correct, not just that they exist
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* use constructor semantics to zero init the context pointer, avoid one memory sanitizer warning
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* to avoid UB with streams, keep attr sizes with int32 size
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* handle an empty buffer cleanly
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
---------
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
- readPixels and readPixelSampleCounts were not consistent in frame
buffer checks
- pixelData is allowed to be null but wasn't being guarded against
- Clear up message around check being run to apply the decode chunk
cache
- add common optimization for sample count copying
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
tiled deep files which are uncompressed incorrectly write a "full" tile
worth of sample counts, except the data is actually tight packed to the
smaller portion of that tile size (i.e. at coarser levels or at
boundaries of non-tile multiple images). so handle that check against
the memory size when copying uncompressed data to unpack (i.e. when in
the non-cumulative count mode)
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
This should fix 2 of the code scan security warnings, at no particular
cognitive overhead, although is just in tests anyway
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Previous commits had tried to reduce the number of calls to chunk offset
but that prevented updates during partial header changes
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
This makes construction consistent with core, where by once constructed,
the object is ready to be used. (file is opened and parsed or ready for
population)
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
This will allow users of the pipeline to run the compression /
decompression, and to replace the C++ compressor utilities. This also
adds some additional checks and looser memory restrictions to the
decompression scheme for ease when we don't have all the information
needed for encoding / decoding.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
This will allow us to have a context without having to actually have a
file (i.e. to use a header object in the C++ layer, or compression)
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Once all the input classes are done, will refactor to lift code out of
the internals of data to common elements in a singular place to avoid
code duplication.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
No need to cache a variable only used in an exceptional case, start to
prep for refactor of data block into context
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
This also adds a bypass to avoid double copy, simpler memory management,
and prepping to have some common code refactored
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
When a chunk is missing, c++ would test if the offset is 0 and throw a
different exception, replicate that here
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
test code was comparing one image to itself, fix this, but the ratio
check was too narrow for half float values
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
simplifies input file as well. Future changes may lift common code out
of scanline input into common utility in context / somewhere.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Not sure why this was coded this way, must have been a separate /
previous bug, but b44 / b44a are not exempt from the rule that if the
compression is larger, store uncompressed.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
reduce scope of variables, collapse logic to avoid duplicate conditional
blocks, re-enable failable free test (original issues had already been
fixed, but test had not been re-enabled)
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
The C++ library had arbitrary (duplicate, non-editable) checks against a
max chunk count, because the IO streams can't always provide the file
size as a safety check. reproduce that here
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
This is not complete (some of the dependencies are circular, so depends
on other later conversions to finish), so represents a WIP state
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Add additional constructor to opaque attribute to enable this.
Registered custom attributes still TODO
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
These are not final, but should represent concepts we will use in new
world of using the core to replace the internals of the C++
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
This will enable use of string_view and similar API convenience as makes
sense. Given 17 has been standard for 4 years of VFX Platform, this
should be ok.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Rewrite python bindings with pybind11 and numpy
This introduces an entirely new python API for reading and writing
OpenEXR files that supports all file features (or will soon):
scanline, tiled, deep, multi-part, etc. It uses numpy arrays for pixel
data, and it supports both separate arrays for each channel and
interleaving of RGB data into a single composite channel. It leaves
the existing binding API in place for backwards-compatibility; there's
no overlap between the two APIs.
See src/wrappers/python/README.md for examples of the new API.
The API is simple: the ``File`` object holds a py::list of ``Part``
objects, each of which has a py::dict for the header and a py::dict
for the channels, and each channels hold a numpy array for the pixel
data. There's intentionally no support for selective scanline/time
reading; reading a file reads the entire channel data for all parts.
There *is*, however, an option to read just the headers and skip the
pixel data entirely.
A few things don't work yet:
- Reading and writing of deep data isn't finished.
- ID manfest attributes aren't supported yet.
- For mipmaped images, it current only reads the top level.
This also does not (yet) properly integrate the real Imath types. It
leaves in place for now the internal "Imath.py" module, but defines
its own internal set of set of Imath classes. This needs to be resolve
once the Imath bindings are distributed via pypi.org
The test suite downloads images from openexr-images and runs them
through a battery of reading/writing tests. Currently, the download is
enabled via the ``OPENEXR_TEST_IMAGE_REPO`` environment variable that
is off by default but is on in the python wheel CI workflow.
This also adds operator== methods to ``KeyCode`` and ``PreviewImage``,
required in order to implement operator== for the ``Part`` and
``File`` objects.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Fix subsampling
Signed-off-by: Cary Phillips <cary@ilm.com>
* - Make README.md examples more pythonic
- Add __enter__/__exit__ so "with File(name) as f" works
- Allow channel dict to reference pixel array directly
- Fix subsampling
Signed-off-by: Cary Phillips <cary@ilm.com>
* Use numpy/tuples in place of Imath types
Also:
- Use single-element array for DoubleAttribute
- Use fractions.Fraction for Rational
- Use 8-element tuple for chromaticities
- Add __enter__/__exit__ so "with" works with File object
- remove operator== entirely, it's way too hard to implement something that's
actually useful for testing purposes. The tests do their own validations.
Signed-off-by: Cary Phillips <cary@ilm.com>
pixel comparison
Signed-off-by: Cary Phillips <cary@ilm.com>
* Deep reading/writing works for both scanline and tiles
Also works properly for separate channels and when coalescing into
RGB/RGBA arrays.
Signed-off-by: Cary Phillips <cary@ilm.com>
* doc strings
Signed-off-by: Cary Phillips <cary@ilm.com>
* Rename rgba param to separate_channels, off by default.
Signed-off-by: Cary Phillips <cary@ilm.com>
* remove numpy as build requirement
Signed-off-by: Cary Phillips <cary@ilm.com>
* Rename rgbaChannel() to channelNameToRGBA; rename is_* to objectTo*
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add "deprecated" to InputFile/OutputFile/Imath doc strings
Signed-off-by: Cary Phillips <cary@ilm.com>
* Explicitly set python versions for wheel workflows, and exclude 3.13
Signed-off-by: Cary Phillips <cary@ilm.com>
* resolve conflicts
Signed-off-by: Cary Phillips <cary@ilm.com>
* resolve conflict
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
Scanning with CodeQL vesion 2.18.1 appears to run amok and fail with
"no space left on device". The runs have traditionally taken around 5
minutes, but after the 2.18.1 release, they're failing after an hour.
Pin to the SHA for 2.18.0 for now, until there's a solution.
Signed-off-by: Cary Phillips <cary@ilm.com>
* add exrmetrics tool (no tile support yet)
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* fix windows build
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* fix test for parameters
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* omit filenames from exrmetrics output to simplify JSON compatibility
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* better diagnostics in exrmetrics test
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* print return code of mysteriously failing test
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* initialize compression method
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* support tiled images, drop verbose option
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* use chrono::steady_clock for timing
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
---------
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
They upgraded to a version that requires a glibc newer than is in the
pre-2023 ASWF containers.
See https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4324
The example build is failing, but it turns out the ci build step
duplicates what happens in the validate_openexr_libs.sh script anyway,
so I'm removing it from the workflow.
Signed-off-by: Cary Phillips <cary@ilm.com>
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 <cary@ilm.com>
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 <kdt3rd@gmail.com>
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 <kdt3rd@gmail.com>
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 <kdt3rd@gmail.com>
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 <cary@ilm.com>
* Set archive prefix for signed releases
This makes it so the signed release archives extract to a subdirectory
named with the tag without the leading 'v', e.g. "openexr-3.2.4". The release tarball has the same name.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Set job-specific write permission
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
Readthedocs builds the website on ubuntu-20.04, so technically that's
the only system that requires the website to build properly, but
developers contributing to the website may work on Windows or macOS,
so this confirms that it builds properly there, too.
Now that the test image files are no longer generated at build time,
no need to install imagemagic and openexr or run the test_image.py
script.
Signed-off-by: Cary Phillips <cary@ilm.com>
- Per OpenSSF, permissions should be read at the top level, with
additional permissions only for the necessary run.
- Add .github/dependabot.yml
- Fix a typo in the website_workflow's filters.
- Run the snyk-scan only on the main repo, not forks, since it
requires secrets.
Signed-off-by: Cary Phillips <cary@ilm.com>
* add page on scene-linear to website
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* require 'dot' in website workflow test. Add helpful links
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* require graphviz for chart
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* separate chart-to-png conversion, move synonyms to footnotes
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* add caveat about EXR contents; clarify input and scene linear
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* tweaks to introduction and gray card section
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* terminology tweaks and other fixes suggested by Cary
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* add carrots image and link
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* simplify scene-linear explanation in website home page
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* improve graph rendering; fix more typos
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
---------
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* add -erase option to exrstdattr
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* reorder operations and add test for erase in exrstdattr
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
---------
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* Document steps in ImfCompression.h
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* Add some steps I had missed.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* Move description to ImfCompression.cpp and mention the C API first.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* no functional change: use regular comment style and trim trailing whitespace.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
---------
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
Fix Scorecard breaking due to not being able to sign the results. Scorecard uses Sigstore tool to sign its results and Sigstore has done an update (https://blog.sigstore.dev/tuf-root-update/). This update is not compatible with older Scorecard versions (for example, v.2.1.2 used here), but Scorecard v2.3.1 is compatible with Sigstore changes.
Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>
When constructing the decompress side of dwaa/b compression support,
simple typo when computing the prefix length as distance between
pointers causing the length to be wrong, triggering csc decompression
values to be wrong when decompressed.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* CMake packaging fix.
Add find_dependency for the new dependency libdeflate, and remove the REQUIRED flag. find_dependency will pickup the correct flag from the calling find_package call.
Signed-off-by: Peter Steneteg <peter@steneteg.se>
* find_dependency only if libdeflate_FOUND
Signed-off-by: Cary Phillips <cary@ilm.com>
* Need to expand the libdeflate_FOUND variable at configure_file time
Signed-off-by: Peter Steneteg <peter@steneteg.se>
---------
Signed-off-by: Peter Steneteg <peter@steneteg.se>
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
Automatically generating .jpg images for display under "Test Images"
as a step in building the website seemed like a good idea a the time,
but is too hard to maintain. I couldn't get the process to work across
Linux, macOS, and Windows, which means no Windows/macOS-based
developers can contribute to the website.
The https://github.com/AcademySoftwareFoundation/openexr-images repo
now has a permenant sidecar .jpg file associated with each .exr which
serves as a proxy for display on the website.
The `website/scripts/test_images.py` is still in place but is now to
be run manually to generate the website `.rst` and the associated
`.rst` files describing each image. Anyone providing additional test
images to the`openexr-image` repo should contribute an associated
`.jpg` for display.
To contribute additional images, first add the images to the image
repo, then run the `website/scripts/test_image.py`, and commit the
new/modified `.rst` files(s).
Signed-off-by: Cary Phillips <cary@ilm.com>
The macros used to check the context arguments and define a part to
reduce boilerplate were confusingly named and with collapsing type
names, creating duplicate / unnecessary variables
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
rename the internal struct to match the priv struct in the context
declaration, such that we can avoid extra variables and just access the
context, and make a similar change for part.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Sphinx handling of `html_logo` and `html_favicon` changed in version 6,
but changing to the documented logo_url and favicon_url still doesn't
work for some reason. But Sphinx 5.3 works, so let's pin to that. This
will need to get sorted out at some point, when there's a need to move
to a newer sphinx.
Signed-off-by: Cary Phillips <cary@ilm.com>
Run the ci_workflow and website_workflow only on changes to the
appropriate source files and workflow files.
Signed-off-by: Cary Phillips <cary@ilm.com>
Readthedocs triggers a build on PR, and a link is provided in the PR
checks, but it's obscure. This action adds a link to the PR
description, but only for PR's that actually modify the website.
Signed-off-by: Cary Phillips <cary@ilm.com>
The OPENEXR_INSTALL_EXAMPLES option is misleading and doesn't have any effect.
It might be safely removed in favor of the OPENEXR_BUILD_EXAMPLES option.
Signed-off-by: Aliaksei Urbanski <aliaksei.urbanski@gmail.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
`test_exrmanifest.py` mirrors the other tool tests in validating
command line arguments. The test images were generated by running the
`deepidexample` example program with its various arguments. The
associated `.txt` are snapshots of the output of `exrmanifest`, so
they validate that the output hasn't changed. Should a future change
to the library/program change the format or content of the output, the
files will need to be updated.
Signed-off-by: Cary Phillips <cary@ilm.com>
https://repology.org provides autogenerated tables of package versions
for many linux distros
Also, add workflow_dispatch trigger, because it's handy during debugging.
Signed-off-by: Cary Phillips <cary@ilm.com>
* cmake generates relevant files to integrate all compression methods.
See CMakeLists.txt for details.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* update utilities
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* fix gitignore
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* sanity check for gaps in enum ids.
suggested by @peterhillman.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* Use isValidCompressionId() instead of hard-coded test.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* generate ImfCRgbaFile.h
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* move implementation to ImfCompression.cpp to hide CompressionDesc.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* convert IdToDesc to a static array.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* ImfCompressor.h was not correctly removed from the list.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* replace cmake_path() with string() if cmake version < 3.20.0. Flagged by @cary-ilm.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* Only generate the files with option UPDATE_COMPRESSOR_LIST=ON.
All files are generated during configuration, making them available for bazel. See comments at the top of src/lib/OpenEXR/CMakeLists.txt.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* Fix incorrect defines.
spotted by @peterhillman
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* Improve DO NOT EDIT messages.
suggested by @peterhillman.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* Add new testCompressionApi test.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* Enable UPDATE_COMPRESSOR_LIST in ci_workflow.yml.
Suggested by @peterhillman.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* Add missing ImfCompression.cpp to BUILD.bazel
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* Remove cmake file generation but keep codec API and tests.
Thanks to @cary-ilm and @peterhillman.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
Fixed: I missed a couple of lines in the CI setup.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
fix whitespace to minimize diff
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
fix whitespace to minimize diff
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
fix whitespace to minimize diff
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* Restore comments describing the codecs.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* Move isValidCompression, isValidCompression, isValidDeepCompression from ImfCompressor to ImfCompression.
- simplify logic in isLossyCompression and isValidDeepCompression.
- additional clarifications in comments / doc strings.
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
---------
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
* fix sporadic UB in dwa
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Allow partial chunk tables
This will fix#1642, re-enabling partial chunk tables during
reconstruction (at least for the last part read). Correctly handles
reconstructing tables where discovered tiles are shifted from expected
indices
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Avoid OOB write
When reconstructing chunk table with corrupt chunks, avoid writing out
of bounds
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* avoid undefined behavior
unaligned reads are UB, use (__builtin_) memcpy
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
---------
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Add some additional safety checks, but properly handle when there are 0
samples in a deep scanline / tile (chunk)
Should fix#1639 and OSS-Fuzz 66612
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Fix version tag for sdist
Signed-off-by: Cary Phillips <cary@ilm.com>
* Don't set OPENEXR_RELEASE_CANDIDATE_TAG for the non-test publish
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* Build python wheels via scikit-build-core
This converts the setuptools configuration for building python wheels
to use scikit-build-core, which has better support for CMake. There is
no more setup.py; the configuration is entirely in `pyproject.toml`
and the compile/link is done exclusively via cmake.
The build/publish policy is:
* A PR that changes any of the python wheel source/configuration
(src/wrappers/python/* or .github/workflows/python-wheels.yml)
triggers a build as a check.
* PRs that change other library source do *not* trigger a build of the
python wheels. Note that the primary CI workflow does build and test
the bindings, although only for a single python version on a single
arch for Linux/macOS/Windows. The wheel building validates multiple
python versions and architectures, but involves signifant
computation/time. Currently, the python wheels are a thin wrapper
about basic read/write functions that don't add significant
additional functionality to the library. Any potential problem will
almost certainly get caught by the primary CI.
* A tag of the form `v3.[0-9]+.[0-9]+-rc*` (e.g. `v3.2.4-rc`) triggers
a full build of the wheels followed by a publish to
`test.pypi.org`. This validates release candidates.
* Publishing a release triggers a full build of the wheels followed by
a publish to `pypi.org`.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add custom README.md for pypi.org
Signed-off-by: Cary Phillips <cary@ilm.com>
* fix typo
Signed-off-by: Cary Phillips <cary@ilm.com>
* reference src/wrappers/python/README.md in pyproject.toml
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add copyright notice
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update pyproject.toml
Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update pyproject.toml
Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update src/wrappers/python/CMakeLists.txt
Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add uninstall target (#1624)
* Add uninstall target
Satisfy the OpenSSF Best Practices Badge requirement for an
insta/uninstall process:
https://www.bestpractices.dev/en/criteria/1#1.installation_common
CMake does not support a standard "uninstall" target, but the
community recommends implementing an "uninstal" target that remove files named in the
`install_manifest.txt`:
https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake
However, our existing process of installing the symlink to the "bare"
library, i.e. the symlink from libImath-3_2.so to libImath.so, fails
to add the symlink to the manifest, so "make uninstall" misses the
symlink. The existing mechanism use "install(CODE execute_process(cmake -E create_symlink))".
This changes that to use a simpler "file(CREATE_LINK)" and
"install(FILES)" to accomplish the same thing while also registering
the symlink the the manifest.
Also, this fixes an issue where `OpenEXRConfig.h` was passed to
`install()` twice, producing two entries in `install_manifest.txt`.
Signed-off-by: Cary Phillips <cary@ilm.com>
* mention uninstall in install instructions
Signed-off-by: Cary Phillips <cary@ilm.com>
* poke
Signed-off-by: Cary Phillips <cary@ilm.com>
* COPY_ON_ERROR
Signed-off-by: Cary Phillips <cary@ilm.com>
* clarify the uninstall instructions
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add cmake.targets and OPENEXR_INSTALL=OFF
Signed-off-by: Cary Phillips <cary@ilm.com>
* INSTALL_TOOLS=OFF
Signed-off-by: Cary Phillips <cary@ilm.com>
* propogate OPENEXR_INSTALL to Imath
Signed-off-by: Cary Phillips <cary@ilm.com>
* test1
Signed-off-by: Cary Phillips <cary@ilm.com>
* OPENEXR_INSTALL_PKG_CONFIG
Signed-off-by: Cary Phillips <cary@ilm.com>
* Fix CVE 2023 5841 (#1627)
* enable deep file checks for core
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* fix possible int overflow
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* fix validation of deep sample counts
Addresses CVE-2023-5841, fixing sample count check to not only check
against 0 but previous sample as well.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* add clarifying comment
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
---------
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Bazel support: Bump Imath to 3.1.10 (#1626)
Signed-off-by: Vertexwahn <julian.amann@tum.de>
* Document security expectations (#1623)
* Document security expectations
Signed-off-by: Cary Phillips <cary@ilm.com>
* Menion Imath as a dependency
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update SECURITY.md
Co-authored-by: Nick Porcino <meshula@hotmail.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
* change 'Threat Model' to 'Potential Vulnerabilties'
Signed-off-by: Cary Phillips <cary@ilm.com>
* Mention GitHub issue as fallback security contact
Signed-off-by: Cary Phillips <cary@ilm.com>
* github security advisory
Signed-off-by: Cary Phillips <cary@ilm.com>
* mention exrcheck
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Nick Porcino <meshula@hotmail.com>
* Add uninstall target (#1624)
* Add uninstall target
Satisfy the OpenSSF Best Practices Badge requirement for an
insta/uninstall process:
https://www.bestpractices.dev/en/criteria/1#1.installation_common
CMake does not support a standard "uninstall" target, but the
community recommends implementing an "uninstal" target that remove files named in the
`install_manifest.txt`:
https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake
However, our existing process of installing the symlink to the "bare"
library, i.e. the symlink from libImath-3_2.so to libImath.so, fails
to add the symlink to the manifest, so "make uninstall" misses the
symlink. The existing mechanism use "install(CODE execute_process(cmake -E create_symlink))".
This changes that to use a simpler "file(CREATE_LINK)" and
"install(FILES)" to accomplish the same thing while also registering
the symlink the the manifest.
Also, this fixes an issue where `OpenEXRConfig.h` was passed to
`install()` twice, producing two entries in `install_manifest.txt`.
Signed-off-by: Cary Phillips <cary@ilm.com>
* mention uninstall in install instructions
Signed-off-by: Cary Phillips <cary@ilm.com>
* poke
Signed-off-by: Cary Phillips <cary@ilm.com>
* COPY_ON_ERROR
Signed-off-by: Cary Phillips <cary@ilm.com>
* clarify the uninstall instructions
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* Remove snyk-scan-pr.yml (#1631)
This workflow is causing errors on each PR:
Snyk is missing auth token in order to run inside CI. You must include your API token as an environment value: `SNYK_TOKEN=12345678`
Error: Process completed with exit code 2.
As discussed on #1608, the preferred workflow will run weekly, not on PR.
Signed-off-by: Cary Phillips <cary@ilm.com>
* fix issue with unpacking sample counts (#1630)
When unpacking sample counts as "individual" counts (no longer
monotonic), it writes the total sample count to a value 1 past the
individual sample counts, but this is not in the packed data, so do not
expect to unpack that many values. The buffer just needs to be allocated
one value larger to avoid write past end of buffer which is taken care
of in the update_pack_unpack_ptrs function
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* adjust checks for core to better match c++ checks (#1632)
The core checks were not setting the same image / tile size limits and
not disabling reads at quite the same level.
Note: the core check does not read the entire image into a contiguous
slice, so does not replicate the maximum deep sample checks in the same
way, this is a source of potential false-negative failures
This should address OSS-Fuzz 66491 and 66489 (different forms of the
same failure where a large sample size allocation was happening), and
are only constrained memory (2.5Gb) issues.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Fix install of symlink (#1633)
PR #1624 caused the .so symlink without the `OPENEXR_LIB_SUFFIX`
(e.g. libOpenEXR.so which links to libOpenEXR-3_2.so) to get created
in the wrong directory. This caused certain invocations of cmake to
fail, even though the invocation in the CI succeeded. It's not at all
clear why.
This also changes the CI to invoke cmake in the way that previously
failed (e.g. from the top-level directory with `-B` and `-S`), as an additional check.
Signed-off-by: Cary Phillips <cary@ilm.com>
* adds a shortcut to avoid reconstructing every call (#1634)
When there is a loop trying to get scan / tile info that is ignoring
return values, add a shortcut to avoid trying to reconstruct the chunk
table every time. This will still respect the strict header flag, either
returning an error immediately (strict), or (non-strict) enabling a
multi-part file with only partially corrupt parts to work.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* check and control reduceMemory and reduceTime in stream mode (#1635)
exrcheck by default uses file mode, but the fuzzer and exrcheck -s use
stream mode, need to respect the memory and time flags consistently on
that path as well.
Will address OSS-Fuzz 66612, although real fix underlying is in #1634
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Update .github/workflows/python-wheels-publish-test.yml
Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add sdist
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update .github/workflows/python-wheels-publish-test.yml
Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
* fix sdist; remove debugging
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Vertexwahn <julian.amann@tum.de>
Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
Co-authored-by: Kimball Thurston <kdt3rd@gmail.com>
Co-authored-by: Vertexwahn <julian.amann@tum.de>
Co-authored-by: Nick Porcino <meshula@hotmail.com>
exrcheck by default uses file mode, but the fuzzer and exrcheck -s use
stream mode, need to respect the memory and time flags consistently on
that path as well.
Will address OSS-Fuzz 66612, although real fix underlying is in #1634
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
When there is a loop trying to get scan / tile info that is ignoring
return values, add a shortcut to avoid trying to reconstruct the chunk
table every time. This will still respect the strict header flag, either
returning an error immediately (strict), or (non-strict) enabling a
multi-part file with only partially corrupt parts to work.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
PR #1624 caused the .so symlink without the `OPENEXR_LIB_SUFFIX`
(e.g. libOpenEXR.so which links to libOpenEXR-3_2.so) to get created
in the wrong directory. This caused certain invocations of cmake to
fail, even though the invocation in the CI succeeded. It's not at all
clear why.
This also changes the CI to invoke cmake in the way that previously
failed (e.g. from the top-level directory with `-B` and `-S`), as an additional check.
Signed-off-by: Cary Phillips <cary@ilm.com>
The core checks were not setting the same image / tile size limits and
not disabling reads at quite the same level.
Note: the core check does not read the entire image into a contiguous
slice, so does not replicate the maximum deep sample checks in the same
way, this is a source of potential false-negative failures
This should address OSS-Fuzz 66491 and 66489 (different forms of the
same failure where a large sample size allocation was happening), and
are only constrained memory (2.5Gb) issues.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
When unpacking sample counts as "individual" counts (no longer
monotonic), it writes the total sample count to a value 1 past the
individual sample counts, but this is not in the packed data, so do not
expect to unpack that many values. The buffer just needs to be allocated
one value larger to avoid write past end of buffer which is taken care
of in the update_pack_unpack_ptrs function
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
This workflow is causing errors on each PR:
Snyk is missing auth token in order to run inside CI. You must include your API token as an environment value: `SNYK_TOKEN=12345678`
Error: Process completed with exit code 2.
As discussed on #1608, the preferred workflow will run weekly, not on PR.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add uninstall target
Satisfy the OpenSSF Best Practices Badge requirement for an
insta/uninstall process:
https://www.bestpractices.dev/en/criteria/1#1.installation_common
CMake does not support a standard "uninstall" target, but the
community recommends implementing an "uninstal" target that remove files named in the
`install_manifest.txt`:
https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake
However, our existing process of installing the symlink to the "bare"
library, i.e. the symlink from libImath-3_2.so to libImath.so, fails
to add the symlink to the manifest, so "make uninstall" misses the
symlink. The existing mechanism use "install(CODE execute_process(cmake -E create_symlink))".
This changes that to use a simpler "file(CREATE_LINK)" and
"install(FILES)" to accomplish the same thing while also registering
the symlink the the manifest.
Also, this fixes an issue where `OpenEXRConfig.h` was passed to
`install()` twice, producing two entries in `install_manifest.txt`.
Signed-off-by: Cary Phillips <cary@ilm.com>
* mention uninstall in install instructions
Signed-off-by: Cary Phillips <cary@ilm.com>
* poke
Signed-off-by: Cary Phillips <cary@ilm.com>
* COPY_ON_ERROR
Signed-off-by: Cary Phillips <cary@ilm.com>
* clarify the uninstall instructions
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add explanation of the distinction between OpenEXR/OpenEXRCore to API section
This was described in the release notes but was never addressed in the
actual online documentation, where it was not, in fact, obvious.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update website/API.rst
Co-authored-by: Nick Porcino <meshula@hotmail.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Nick Porcino <meshula@hotmail.com>
* Support cmake config and shared library for libdeflate
When not using the internal deflate, the only option was pkgconfig which
is not well supported on Windows. This adds support for using the
libdeflate cmake config files when available.
This change also affects the generated OpenEXR cmake config files. For
a static OpenEXR library, INTERFACE_LINK_LIBRARIES now appropriately
includes libdeflate along with the existing dependencies like Imath.
It also turns the internal libdeflate into a target for consistency.
Resolves#1588
Signed-off-by: Brecht Van Lommel <brecht@blender.org>
* Back out of adding a target for internal libdeflate
Signed-off-by: Brecht Van Lommel <brecht@blender.org>
* Use Requires.private for generated pkgconfig file
Signed-off-by: Brecht Van Lommel <brecht@blender.org>
---------
Signed-off-by: Brecht Van Lommel <brecht@blender.org>
- added example C/C++ Code scanner using the Snyk GitHub Action.
The `--unmanaged` flag indicates this is for a C/C++ codebase. In this
example, it currently scans on a new pull request to the 'main'
branch. The repository administrator should set both the SNYK_ORG and
SNYK_TOKEN environment variables before merging this PR. The
environment variables can be obtained from the LFX Security team.
- added *.h, *.c, *.cpp filter to only run the scan when source files
are changed
Signed-off-by: David Deal <ddeal@linuxfoundation.org>
The .mailmap file maps author/committer names and emails to canonical
real names and email addresses.
This also updates the CONTRIBUTORS.md file with missing names from the
git logs.
This information is to the best of our knowledge, but please submit
any corrections if you prefer.
Signed-off-by: Cary Phillips <cary@ilm.com>
The version on main stays a minor release ahead of the latest release,
currently 3.2.1. This should have gotten bump right after the 3.2.0
release.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Converting code-blocks to literalincludes in ReadingAndWritingImageFiles.rst
Signed-off-by: Megha S <megha199501@gmail.com>
* Addressed review comments
Signed-off-by: Megha S <megha199501@gmail.com>
* Changing from std::clamp to Imath::clamp
Signed-off-by: Megha S <megha199501@gmail.com>
---------
Signed-off-by: Megha S <megha199501@gmail.com>
* Replaced the sample exr file code blocks with a grid table formatted with bytes of the sample file in one column. The value in the second column and the third column being the description of the bytes and value.
Signed-off-by: An Nguyen <annguyen@ilm.com>
* * Updated so the ascii values for the bytes are aligned to each byte.
* Gave the table a title and reduce the width to 50%
Signed-off-by: An Nguyen <annguyen@ilm.com>
* Added missing 4 bytes missing from the dataWindow value and displayWindow value
Signed-off-by: An Nguyen <annguyen@ilm.com>
* Added the sample.exr file
Signed-off-by: An Nguyen <annguyen@ilm.com>
* Annotated the attribute values more for the header. Should be a bit clearer.
Signed-off-by: An Nguyen <annguyen@ilm.com>
* Adding the sample.exr file was documented.
Signed-off-by: An Nguyen <annguyen@ilm.com>
* Added download link to the sample.exr file.
Signed-off-by: An Nguyen <annguyen@ilm.com>
* Move the download link above the table. Updated the paragraph before the table to describe the table
Signed-off-by: An Nguyen <annguyen@ilm.com>
* Move the sample.exr image into the downloads directory to match the target destination naming scheme to avoid confusion where the files go when built
Signed-off-by: An Nguyen <annguyen@ilm.com>
* Updated the table to annotate the type and literal as type.
Signed-off-by: An Nguyen <annguyen@ilm.com>
---------
Signed-off-by: An Nguyen <annguyen@ilm.com>
* add deep id/manifest tools and docs
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* fix const-ness in deepidexample
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* fix link on doc, better variable name
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* add discussion of cryptomatte and deep compositing
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* fix names of cryptomatte ID channels
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
---------
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
The file version is set to 2 above for writing files (it is impossible write version 1 data). Please refer to the history of history of ImfDwaCompressor.cpp or look at the reading code for details on the version 1 format.
Signed-off-by: Dave Sawyer <kingsawyer@gmail.com>
There was an issue with the data type not passed to the DCT decompressor in the DWA decoder. That caused 32 bit DWA images to look squashed, as the decompressed 16 bit values were not getting expanded back to 32 bit.
Signed-off-by: Anton Dukhovnikov <antond@wetafx.co.nz>
These are intended to exercise methods that are currently not covered by
other tests according to the coverage report.
Signed-off-by: Ben Grimes <bgrimes@ilm.com>
The CI platform that builds the wheels is Intel based and
by default only builds Intel wheels.
Modern Macs are all based on Apple Silicon so to support them
we need to also build arm64. This is done via cross compiling.
It is not possible to test when cross compiling according to:
https://cibuildwheel.readthedocs.io/en/stable/faq/#how-to-cross-compile
Signed-off-by: Barnaby Robson <brobson@ilm.com>
* fix typo in README.md
change make -> cmake
Signed-off-by: Barnaby Robson <brobson@ilm.com>
* removes mkdir.
Suggested by Milos in review. I tested it and it works.
Signed-off-by: Barnaby Robson <brobson@ilm.com>
---------
Signed-off-by: Barnaby Robson <brobson@ilm.com>
* Set EXR_DEFLATE_LIB properly for static linking
This leads OpenEXRCore/CMakeLists.txt to do:
target_link_libraries(OpenEXRCore PUBLIC libdeflate)
instead of:
target_link_libraries(OpenEXRCore PUBLIC PkgConfig::deflate)
which is not recognized. With a target link library of
`PkgConfig::deflate`, the static build of the OpenEXR libraries builds
successfully, but configuring an application against those static
libraries fails, saying it can't find `PkgConfig::deflate`.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add -ldeflate to pkgconfig for static builds
When static linking and referencing an external libdeflate (i.e. not
fetching and building internally), OpenEXR.pc needs -ldeflate.
This also adds a test for this condition to the CI's validation script.
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
This allows the url for the test images to reference a local file:
cmake -DOPENEXR_IMAGES_REPO=file:///my/clone/of/openexr-images -DOPENEXR_IMAGES_TAG=""
which avoids the remote downloading of the test images at cmake time.
Also, mention the test images in the install docs.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Python wheel setup gets version from OpenEXR.pc/Imath.pc
OpenEXR and Imath have indepdenent versions that may not match. The
.pc files appear to be the simplest way to extract the versions and
library suffixes.
Running pkg-config itself doesn't work on Windows, hence the manual
file parsing.
Signed-off-by: Cary Phillips <cary@ilm.com>
* =
Signed-off-by: Cary Phillips <cary@ilm.com>
* Remove -DOPENEXR_INSTALL_PKG_CONFIG=ON since it's now on by default
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
There seems to be no downside to generating the OpenEXR.pc file even
on Windows, so for consistency, apply the setting to all platforms.
Signed-off-by: Cary Phillips <cary@ilm.com>
As noted in #1445, _MSC_VER should only be used to detect msvc, not
for Windows. The _WIN32 check should be sufficient. The extra check
for _MSC_VER fails when cross-compiling from Linux to Windows.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Propagate OPENEXR_INSTALL_PKG_CONFIG to internal Imath
If OpenEXR is installing a pkg-config file, then the internal Imath
build (if there is one) should install it, too.
Also, add an explicit release version variable to the .pc file.
This is in preparation for the python wheel build to pick up the
version settings from the pkg-config files.
Signed-off-by: Cary Phillips <cary@ilm.com>
* remove version= from OpenEXR.pc
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* OpenEXRConfig.h.in uses version extracted from openexr_version.h
The logic was already in place to extract the version from
`openexr_version.h`, so the `.in` file just needed to reference the
proper CMake variables. This also duplicates the `OpenEXR_VERSION_*`
settings to `OPENEXR_VERSION_*`.
Signed-off-by: Cary Phillips <cary@ilm.com>
* bazel
Signed-off-by: Cary Phillips <cary@ilm.com>
* comment
Signed-off-by: Cary Phillips <cary@ilm.com>
* fix formatting of core version test error message
Signed-off-by: Cary Phillips <cary@ilm.com>
* fix extra comparison test
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
This frees exrinfo and any other external application from any special
settings to pick up the necessary Imath #includes.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Consolidate external project includes to openexr_conf.h
Signed-off-by: Nick Porcino <meshula@hotmail.com>
* Add path for ImathConfig.h
Signed-off-by: Nick Porcino <meshula@hotmail.com>
* Add missing dependency on OpenEXR::Config to exrinfo
Signed-off-by: Nick Porcino <meshula@hotmail.com>
* Rename openexr_conf.h to openexr_config.h
Signed-off-by: Nick Porcino <meshula@hotmail.com>
* Add Imath dependency to OpenEXRCore
Signed-off-by: Nick Porcino <meshula@hotmail.com>
---------
Signed-off-by: Nick Porcino <meshula@hotmail.com>
This name is more consistent with the others. And the workflow does
not need to run on changes to the website or website source.
Signed-off-by: Cary Phillips <cary@ilm.com>
- Remove the libdeflate patch, not actually necessary
- Add a CMake build setup, controlled ``OPENEXR_BUILD_PYTHON``, off by default
- Update the doc strings
- Add ``#define PY_SSIZE_T_CLEAN``, apparently required in Python 3.10
for ``Py_BuildValue("s#")``. PreviewImage attributes crash
otherwise.
- Add a more extensive unit test
- Disable building PyPy wheels, since the bindings don't work properly
(the ``channels()`` method fails in ``test_unittests.py`` when built
against PyPy)
Signed-off-by: Cary Phillips <cary@ilm.com>
The website does not need to be built on changes to source code, only
on changes in the "website" directory. And the main CI builds/tests
don't need to be triggered by website changes.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Website "Attributes" page now describes all attributes
This gathers all the attribute definitions onto a single page, both
required and optional, and organizes them into logical groups. It also
documents each attribute's type.
Signed-off-by: Cary Phillips <cary@ilm.com>
* update display/data window definitions
Signed-off-by: Cary Phillips <cary@ilm.com>
* clarify some definitions
Signed-off-by: Cary Phillips <cary@ilm.com>
* lose the status column
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
gcc warns of a potentially uninitialized memory reference, in the case
where ``__get_cpuid()`` fails to assign values to all its parameters.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Rename "docs" to "website"
"website" is a more accurate term for the majority of the content that
has been under ``docs``, with the exception of the tool manpages, so:
- The website source now lives in the ``website`` subdirectory (was ``docs``)
- The CMake option is now ``BUILD_WEBSITE`` (was ``BUILD_DOCS``)
- The new CMake target ``website`` now builds the website source (via doxygen, sphinx, etc)
- The CI job is called "Website" (was ``Docs``)
- The CMake target ``docs`` now installs just the tool manpages
- The CMake option ``OPENEXR_INSTALL_DOCS`` controls whether to install the manpages, and defaults to OFF
- [website/install.rst](website/install.rst) explains the process and dependencies
Signed-off-by: Cary Phillips <cary@ilm.com>
* remove src subdir
Signed-off-by: Cary Phillips <cary@ilm.com>
* build website/src; mention posix
Signed-off-by: Cary Phillips <cary@ilm.com>
* max
Signed-off-by: Cary Phillips <cary@ilm.com>
* clamp
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
- Move util under share
- Move the scripts under share into share/util
- The . files in src/bin appear to have been committed unncessarily long ago
Signed-off-by: Cary Phillips <cary@ilm.com>
When compiling for x86-64-v3 (or with -mavx -mf16c), bypass the CPUID
detection entirely, as osxsave is not (nor need be) defined in that
case.
Fixes: #1459
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
- Include all .cpp files in `docs/src` in `docs/src/all.cpp` and add
it as a build dependency. This validates that it compiles, although
there's no execution so it still doesn't validate correct behavior.
- Move larger code-blocks from ReadingAndWritingImageFiles.rst into
individual files in `docs/src`
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add detailed instructions for making both patch and major/minor release
This documents the way I've been doing it, I'm certainly open to
improvements. Certainly a lot of this could conceivably be automated.
The key element for a patch release is the SO version and ABI
compatibility, and our SO numbering scheme still needs simplification.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update versioning process with the new policy and ``openexr_version.h``
Signed-off-by: Cary Phillips <cary@ilm.com>
* mention IMATH_TAG in the patch and major/minor release instructions
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* Update and simplify SO versioning policy
This change retires the "libtool" versioning scheme and adopts a
policy of appending the ``MAJOR.MINOR.PATCH`` software release name to
the SONAME to form the real name of the shared library.
The SOVERSION is specified via the ``OPENEXR_LIB_SOVERSION`` setting
in ``CMakeLists.txt`` and is the single number that increments
whenever, and only when, the ABI changes in non-backwards-compatible
ways. In practice, this corresponds to major and minor releases.
The resulting real shared library file names look like, for example,
``libOpenEXR.so.31.3.2.0``, where ``libOpenEXR.so.31`` is the SONAME
and ``.3.2.0`` identifies the corresponding software release.
This naming scheme helps reinforce the correspondence between the
shared library's real file name and the software release it
corresponds to, moreso than would be indicated by a single increasing
number.
By OpenEXR project policy and discussion of the technical steering
committee, the additional versioning information in the libtool
versioning scheme is too confusing and error-prone to follow, without
offering additional practical benefit.
Documentation is in ``CMakeLists.txt`` and in ``docs/install.rst``.
Signed-off-by: Cary Phillips <cary@ilm.com>
* remove reference to libtool
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* Let's see if the wheels are building
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Enable the building on the python branch to can test it
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Wrong path
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Windows...
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Copy the wrapper source files on the main folder
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Skip the OpenEXR examples
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Fixed the library names
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Install pytest to run the tests
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Let's try the cibuildwheel way
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Maybe this way...
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Use require instead of custom command
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Simplified the test
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Specifically instruct pytest to run the tests in the folder
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Fix the test
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Disable threading
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Reenable threading
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Link also OpenEXRCore
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* CIBW_BEFORE_BUILD is the same in all platforms
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Imath 3.1.9
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* List the exported symbols
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* List the exported symbols
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Link everything available
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Link everything available
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Link statically also libdeflate
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* tar.gz, not zip
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* libdeflate static lib name is not found by openexr on windows
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Syntax error
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Try to fix the deflate linking on windows
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* Remove the need of the wildcard while testing
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
* BSD license
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
---------
Signed-off-by: Jose Luis Cercos-Pita <jlcercos@gmail.com>
For consistency with ``OPENEXR_DEFLATE_REPO`` and other config options.
Also, add docs section for the ``DEFLATE`` options.
Signed-off-by: Cary Phillips <cary@ilm.com>
When the number of DC components has been incorrectly stored in the dwa
subheader, this causes a cascade of errors, resulting in out of bounds
access. Instead, track how many we've read and detect when we're out as
soon as possible
Fixes OSS-Fuzz #59457
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
It would appear the precomputed values cause differences from the
specific computed values on other architectures.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Add sensorCenterOffset, sensorOverallDimensions, sensorPhotositePitch and sensorAcquisitionRectangle optional standard attributes
Signed-off-by: Joseph Goldstone <jgoldstone@arri.com>
* Add descriptions of sensorCenterOffset, sensorOverallDimensions, sensorPhotositePitch, and sensorAcquisitionRectangle to doc page for standard optional attributes
Signed-off-by: Joseph Goldstone <jgoldstone@arri.com>
* Fix typo in, and use correct inter-item spacing for Sphinx, in standard optional attributes doc
Signed-off-by: Joseph Goldstone <jgoldstone@arri.com>
---------
Signed-off-by: Joseph Goldstone <jgoldstone@arri.com>
* Readdress #1456: disallow NaNs in testOptimizedInterleavePatterns unless both writing and reading as half
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* fix typos
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
---------
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
I tried compiling the source to ``exrheader`` against an installation
of OpenEXR and it failed because it includes ``ImfMisc.h`` and
``ImfCompressor.h``, which were not included in the list of installed
headers.
It seems that code should be buildable by the public API, so those
headers should, in fact, be distributed.
Signed-off-by: Cary Phillips <cary@ilm.com>
PR #1323 introduces a nested #ifdef check that results in a performance
regression on Linux systems that use the clang compiler. This is because
the check for __clang__ succeeds, but the nested check for __APPLE__
fails. As a result, the elif case is not taken on Linux.
Fixes issue #1479
Signed-off-by: Peter Urbanec <peterurbanec@users.noreply.github.com>
* Fix build error on win_arm64
Signed-off-by: Christoph Gohlke <cgohlke@cgohlke.com>
* Simplify fix for build error on win_arm64
Signed-off-by: Christoph Gohlke <cgohlke@cgohlke.com>
---------
Signed-off-by: Christoph Gohlke <cgohlke@cgohlke.com>
The current code asumes glibc == linux. This patch extends support to all non-glibc Linux systems.
Signed-off-by: Cristian Othón Martínez Vera <cfuga@cfuga.mx>
It looks like there are some non-ASCII characters present in the code. Specifically, the character "–" in the line:
Signed-off-by: zengwei2000 <102871671+zengwei2000@users.noreply.github.com>
It looks like there are some non-ASCII characters present in the code. Specifically, the character "–" in the line:
Signed-off-by: zengwei2000 <102871671+zengwei2000@users.noreply.github.com>
* Fix cpu detection of sse2 on non-64 x86
Previous code accidentally elided the i386 (i.e. non-64 bit versions of
x86 compiles). This refactors and simplifies the ifdef snarl to clarify
and fix that.
Fixes#1459
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Fix mismatch with windows and enable avx support check there
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Disable avx detection under msvc for now
We require gcc / clang style inline asm for avx support, detecting it
properly causes problems for the dwa support which uses that. Disable
again.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
---------
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Fix macOS and Windows build failures when threading is disabled
Addresses #1455
The logic around which implementation of the IlmThread::Semaphore
class to use is now consolidated into the block of code that deciphers
the platform and specifies the #includes, rather than spread across
multiple files.
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add macOS/Windows builds with threading disabled
Signed-off-by: Cary Phillips <cary@ilm.com>
* Fix typo with ILMTHREAD_SEMAPHORE_OTHER, and add missing macOS includes
Signed-off-by: Cary Phillips <cary@ilm.com>
* Add threads-enabled='ON' so it shows up in the job name
Signed-off-by: Cary Phillips <cary@ilm.com>
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
* don't use NaNs/infs in testOptimizedInterleavePatterns
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
* allow NaN/inf halfs in testOptimizedInterleavePatterns if not casting to float
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
---------
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
openexr.com forwards to openexr.org, but for consistency, let's refer
to all email addresses as @openexr.com, to match the website.
Signed-off-by: Cary Phillips <cary@ilm.com>
Removes all other calls to internal_exr_alloc if there is a context,
allowing full memory allocator overload without setting global
functions.
Also cleanup code formatting
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* fix potential crash
* Add initial tests for half utility operations in core
* add dump of attr to support testing of debug code (coverage)
* Add simple script around running and generating coverage report locally using clang tools
---------
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
libdeflate doesn't have the same fallback handling such that if
someone resets the pointers, allocations later will crash
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Fix nodiscard warning on gcc 13
* Add buffer range checks to huf code
* Refactor cpuid code for use in dwa
* Fix issue with big endian deep encoding of chunk table
* refactor to expose byte reordering zip compression uses for dwa
* expose option flag to enable headers to be more easily like old style headers
* fix potential issue with piz and not able to compress data small enough
* Restore piz tests
* Initial implementation of DWAA/B compression for Core
* write with legacy header during tests to make comparing bytes in files easier
* Initial support for validating exact match in file output between C / C++
* Enable DWAA/DWAB tests
* Older versions of MSVC have issues with specifying C11 for use of
stdalign.h and alignas macro. Work around this by targeting the lower
level macros / declspec instead of using C11 stdalign.h
* Add unit test for x86 cpu id checks
* Add alignment helper utility
* Add missing include guards
* Fix pedantic warnings
* Fix compile warnings. Core should now compile with
-Weverything
-Wno-reserved-identifier
-Wno-covered-switch-default
-Wno-cast-align
-Wno-overlength-strings
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Shift MacOS versions in flight
github has long deprecated version 10.15
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Fix versioning updates to match VFX platform with github supported o.s.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
---------
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
This code appears to have not made it through the v3.0 transition, the
associated CMakeList.txt has been lost. There isn't much in the git
history describing the program. It seems to do the same thing as
"exrmultipart --combine" so its benefit of maintaining it seems
minimal.
Signed-off-by: Cary Phillips <cary@ilm.com>
* More robust openexr_version.h handling
* hardcode versions for now until the vagaries of Bazel and linux install scripts can be sorted out
Signed-off-by: Nick Porcino <meshula@hotmail.com>
- Add manpages for the tool programs (exr2aces, exrenvmap, etc)
- Pages are generated via help2man
- Pages are installed into share/man
- Standardize the tool usage messages:
* The output of --help goes to stdout, so that "exrheader --help | more" is easy
* Usage output goes to stderr on mistakes like malformed arguments
* Each program has a --version option
* ImfMisc.h has a getLibraryVersion() that returns the
CMAKE_OPENEXR_VERSION the library was compiled with (which might
be mismatched with the headers currently being compiled.
- The website has a "Tools" page that describes the tools and usage,
but also includes a pointer to oiiotool for any serious image
processing utilities
- The website html output is no longer installed with the
distribution. This was inadvertent and not helpful, a leftover from
when "docs" referred to the .pdf technical documentation that now
lives on the webpage.
Signed-off-by: Cary Phillips <cary@ilm.com>
Switches to embedding upstream (MIT license) libdeflate vs linking
against external library, functions should be private / hidden by
default.
Like Imath, enables one to use a system version or force using an
internally embedded version (OPENEXR_FORCE_INTERNAL_DEFLATE).
Further, the repository used can be controlled with
OPENEXR_DEFLATE_REPO and OPENEXR_DEFLATE_TAG cmake variables.
This centralizes all IETF RFC 1950 (zlib) compression into
the EXRCore library. This implies that the main C++ library
depends on EXRCore.
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Fix Issue #890, issue with windows shutdown when exiting quickly prior to
threads actually starting. We do this by having a data block that is passed
by shared_ptr to the thread to avoid dereferencing a deleted object.
Further, greatly simplify the ThreadPool code by using atomic shared_ptr
functions instead of trying to manually implement something similar and
otherwise modernizing the thread code.
Fix a few potential null dereference locations and also fix an issue when
systems are overloaded enabling the TaskGroup destructor to destroy
the semaphore while code is still using it, causing undefined memory
corruption if some other thread immediately allocates that same block
Originally based on a proposed patch by Dieter De Baets @debaetsd
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
The recommendations for macOS were backwards. Homebrew is the
recommended installer. Macports is not recommended, as it's on v2.3.
Signed-off-by: Cary Phillips <cary@ilm.com>
This adds a "Test Image" section to the website with a gallery of images from the test image repo https://github.com/AcademySoftwareFoundation/openexr-images, with a page for each image that shows the output of exrheader. Each image is a link to download the .exr file.
Preview it here: https://cary-ilm-openexr.readthedocs.io/en/docs-images/index.html
It's not perfect, but it's a decent start, feel free to suggest improvements to the layout or content. A few notes:
In lieu of setting up a way to view .exr images directly in a browser, I converted the .exr's in openexr-images to .jpg's. They are stored in the openexr-images repo and served to the website directly from github, so the OpenEXR distribution (which holds the website source) doesn't get bloated with extra image data. The download link downloads the source .exr image, not the .jpg.
This draft actually serves them from a branch of my fork of the openexr-images repo, but that can get fixed later.
The exr2rst.py script generates the rst (and embedded html) from the .exr's (by running exrheader) and the accompanying README's, so it's (relatively) easy to add new images.
---------
Major update to this, the .rst and the proxy .jpg’s are now generated automatically, so no need to maintain .jpg’s in the openexr-images repo.
The docs/test_images.txt file lists urls for .exr’s and README.rst files that define the contents of the “Test Images” page.
The docs/scripts/test_images.py script builds the index page and the per-image pages. It downloads the files via wget, then runs convert (ImageMagick) to generate the proxy .jpg’s, then runs exrheader to generate the tables of attribute values.
The script puts the auto-generated .rst files in the docs/_test_images subdirectory. Ideally, these would go in the build directory, but sphinx seems to want all .rst input under a single source root.
There's now a separate "Docs" CI job that builds the docs, so I removed all references to docs in the other jobs. It uses Ubuntu to mirror .readthedocs.yml. There's no need for the install_doxygen.sh and install_docs_env.sh scripts, the necessary installations are simple enough to do inline in the CI job.
---------
Signed-off-by: Cary Phillips <cary@ilm.com>
2023-04-07 15:42:56 -07:00
1012 changed files with 149437 additions and 84027 deletions
# 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
# cary: the "linked" setting is necessary to force the run to pick up
# the version specified in the action.
tools:linked
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' \
Foundation](https://www.aswf.io). See the project's [governance
policies](GOVERNANCE.md), [contribution guidelines](CONTRIBzuTING.md), and [code of conduct](CODE_OF_CONDUCT)
policies](GOVERNANCE.md), [contribution guidelines](CONTRIBUTING.md), and [code of conduct](CODE_OF_CONDUCT.md)
for more information.
# Building OpenEXR
See the [Install instructions](https://openexr.com/en/latest/install.html) for instructions on how to build
OpenEXR and its required prerequisites.
# Quick Start
See the [technical documentation](https://openexr.readthedocs.io) for
complete details, but to get started, the "hello, world" `.exr` writer program is:
complete details, but to get started, the "Hello, world" [`exrwriter.cpp`](https://raw.githubusercontent.com/AcademySoftwareFoundation/openexr/main/website/src/exrwriter/exrwriter.cpp) writer program is:
- Submit a Pull Request: https://github.com/AcademySoftwareFoundation/openexr/pulls
- If you'd like to contribute and could use some ideas of what to
do, browse "good first issues" [here](https://github.com/AcademySoftwareFoundation/openexr/contribute) or on [Clotributor](https://clotributor.dev/search?ts_query_web=openexr&page=1).
[](https://gitter.im/OpenJPH?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# Readme #
Open source implementation of High-throughput JPEG2000 (HTJ2K), also known as JPH, JPEG2000 Part 15, ISO/IEC 15444-15, and ITU-T T.814. Here, we are interested in implementing the HTJ2K only, supporting features that are defined in JPEG2000 Part 1 (for example, for wavelet transform, only reversible 5/3 and irreversible 9/7 are supported).
The interested reader is referred to the [short HTJ2K white paper](http://ds.jpeg.org/whitepapers/jpeg-htj2k-whitepaper.pdf), or the [extended HTJ2K white paper](https://htj2k.com/wp-content/uploads/white-paper.pdf) for more details on HTJ2K. [This](https://kakadusoftware.com/wp-content/uploads/icip2019.pdf) paper explores the attainable performance on CPU, while [this](https://kakadusoftware.com/wp-content/uploads/ICIP2019_GPU.pdf) and [this](http://hdl.handle.net/1959.4/unsworks_75139) explores performance on the GPU.
# The standard #
The standard is available free of charge from [ITU website](https://www.itu.int/rec/T-REC-T.814/en). It can also be purchased from the [ISO website](https://www.iso.org/standard/76621.html).
# Table of Contents #
* [Status](/docs/status.md)
* [Compiling](./docs/compiling.md)
* [Compiling and Running in Docker](./docs/docker.md)
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.