Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.2.1 commits and release notes #1569

Merged
merged 19 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
5240892
Propagate OPENEXR_INSTALL_PKG_CONFIG to internal Imath (#1531)
cary-ilm Aug 30, 2023
7b80467
Remove check for _MSC_VER in internal_cpuid.h (#1528)
cary-ilm Aug 30, 2023
0650cd2
Fix warnings in multipartExamples.cpp (#1533)
cary-ilm Aug 30, 2023
b9140da
Fix warnings from cross-compiling with x86_64-w64-mingw32-gcc-posix (…
cary-ilm Aug 31, 2023
3073b71
Fix OPENEXR_VERSION_HEX (#1539)
cary-ilm Sep 1, 2023
c261f43
OPENEXR_INSTALL_PKG_CONFIG is on by default, even on Windows (#1541)
cary-ilm Sep 12, 2023
fc993fa
Remove SPDX license identifier in LICENSE.md
cary-ilm Sep 12, 2023
4594b64
Python wheel setup gets version from OpenEXR.pc/Imath.pc (#1536)
cary-ilm Sep 12, 2023
e93131b
Default value for chromaticities attribute constructor in exrstdattr …
cary-ilm Sep 12, 2023
cdf831d
Update openexr_deps.bzl (#1565)
Vertexwahn Sep 18, 2023
08449f9
Bazel: Improve module (#1562)
Vertexwahn Sep 19, 2023
1312455
Set build-shared:OFF for Static build (#1557)
cary-ilm Sep 19, 2023
4f9c1a3
Omit OPENEXR_IMAGES_TAG from test image url if empty (#1560)
cary-ilm Sep 19, 2023
7cda5f5
Clean up handling of libdeflate when linking static (#1561)
cary-ilm Sep 22, 2023
52835b7
Don't trigger ci/bazel/ossfuzz builds on pushes/PRs to src/wrappers (…
cary-ilm Aug 30, 2023
0c69cc0
Set minimal permissions for workflow python-wheels.yml (#1530)
diogoteles08 Aug 29, 2023
eb5556d
Release notes for 3.2.1
cary-ilm Sep 23, 2023
31ec4c3
Fix Imf/Iex/IlmThread namespaces in python bindings and website code …
cary-ilm Sep 23, 2023
8e1fa90
Bump version to 3.2.1
cary-ilm Sep 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/bazel_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ on:
- '!**.md'
- '!website/**'
- 'website/src/**'
- '!src/wrappers/**'
pull_request:
branches-ignore:
- RB-2.*
Expand All @@ -33,6 +34,7 @@ on:
- '!**.md'
- '!website/**'
- 'website/src/**'
- '!src/wrappers/**'

permissions:
contents: read
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ on:
- '!website/**'
- 'website/src/**'
- '!bazel/**'
- '!src/wrappers/**'
pull_request:
branches-ignore:
- RB-2.*
Expand All @@ -36,6 +37,7 @@ on:
- '!website/**'
- 'website/src/**'
- '!bazel/**'
- '!src/wrappers/**'

permissions:
contents: read
Expand Down Expand Up @@ -118,7 +120,7 @@ jobs:
# Static, Release
- build: 4
build-type: Release
build-shared: 'ON'
build-shared: 'OFF'
cxx-standard: 17
cxx-compiler: g++
cc-compiler: gcc
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ossfuzz_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
- '!**.md'
- '!website/**'
- '!bazel/**'
- '!src/wrappers/**'
pull_request:
branches-ignore:
- RB-2.*
Expand All @@ -29,6 +30,7 @@ on:
- '!**.md'
- '!website/**'
- '!bazel/**'
- '!src/wrappers/**'

permissions:
contents: read
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/python-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ on:
- 'website/src/**'
- '!bazel/**'

permissions:
contents: read

jobs:
build_wheels:
name: Build Python wheels
Expand Down
1,202 changes: 619 additions & 583 deletions CHANGES.md

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<!-- SPDX-License-Identifier: BSD-3-Clause -->
<!-- Copyright (c) Contributors to the OpenEXR Project -->

Copyright (c) Contributors to the OpenEXR Project. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand Down
9 changes: 6 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright Contributors to the OpenEXR Project.

module(
name = "openexr",
version = "0.0.0", # The version "0.0.0" is set here and will be patched within the Bazel Central Registry
compatibility_level = 1,
)

bazel_dep(name = "bazel_skylib", version = "1.4.2")
bazel_dep(name = "imath", version = "3.1.9")
bazel_dep(name = "libdeflate", version = "1.18")
bazel_dep(name = "imath", repo_name = "Imath", version = "3.1.9")
bazel_dep(name = "libdeflate", version = "1.19")
bazel_dep(name = "platforms", version = "0.0.7")
6 changes: 3 additions & 3 deletions bazel/third_party/openexr_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ def openexr_deps():
http_archive,
name = "libdeflate",
build_file = "@com_openexr//:bazel/third_party/libdeflate.BUILD",
sha256 = "225d982bcaf553221c76726358d2ea139bb34913180b20823c782cede060affd",
strip_prefix = "libdeflate-1.18",
urls = ["https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.18.tar.gz"],
sha256 = "27bf62d71cd64728ff43a9feb92f2ac2f2bf748986d856133cc1e51992428c25",
strip_prefix = "libdeflate-1.19",
urls = ["https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.19.tar.gz"],
)

maybe(
Expand Down
3 changes: 2 additions & 1 deletion cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,9 @@ if(OPENEXR_INSTALL_PKG_CONFIG)
)
endfunction()
openexr_pkg_config_help(OpenEXR.pc.in)
message(STATUS "OpenEXR pkg-config generation enabled")
else()
message(STATUS "-- pkg-config generation disabled")
message(STATUS "OpenEXR pkg-config generation disabled")
endif()

###################################################
Expand Down
2 changes: 1 addition & 1 deletion cmake/OpenEXR.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Name: OpenEXR
Description: OpenEXR image library
Version: @OPENEXR_VERSION@

Libs: @exr_pthread_libs@ -L${libdir} -lOpenEXR${libsuffix} -lOpenEXRUtil${libsuffix} -lOpenEXRCore${libsuffix} -lIex${libsuffix} -lIlmThread${libsuffix}
Libs: @exr_pthread_libs@ -L${libdir} -lOpenEXR${libsuffix} -lOpenEXRUtil${libsuffix} -lOpenEXRCore${libsuffix} -lIex${libsuffix} -lIlmThread${libsuffix} @EXR_DEFLATE_LDFLAGS@
Cflags: -I${includedir} -I${OpenEXR_includedir} @exr_pthread_cflags@
Requires: Imath

8 changes: 4 additions & 4 deletions cmake/OpenEXRConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@
// clang-format on

// Version as a single hex number, e.g. 0x01000300 == 1.0.3
#define OPENEXR_VERSION_HEX \
((uint32_t (OPENEXR_VERSION_MAJOR) << 24) | \
(uint32_t (OPENEXR_VERSION_MINOR) << 16) | \
(uint32_t (OPENEXR_VERSION_PATCH) << 8))
#define OPENEXR_VERSION_HEX \
(((OPENEXR_VERSION_MAJOR) << 24) | \
((OPENEXR_VERSION_MINOR) << 16) | \
((OPENEXR_VERSION_PATCH) << 8))

// On modern versions of gcc & clang, __has_attribute can test support for
// __attribute__((attr)). Make sure it's safe for other compilers.
Expand Down
20 changes: 15 additions & 5 deletions cmake/OpenEXRSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ set(IEX_INTERNAL_NAMESPACE "Iex_${OPENEXR_VERSION_API}" CACHE STRING "Real names
set(IEX_NAMESPACE "Iex" CACHE STRING "Public namespace alias for Iex")

# Whether to generate and install a pkg-config file OpenEXR.pc
if (WIN32)
option(OPENEXR_INSTALL_PKG_CONFIG "Install OpenEXR.pc file" OFF)
else()
option(OPENEXR_INSTALL_PKG_CONFIG "Install OpenEXR.pc file" ON)
endif()

# Whether to enable threading. This can be disabled, although thread pool and tasks
# are still used, just processed immediately
Expand Down Expand Up @@ -167,6 +163,9 @@ if(NOT OPENEXR_FORCE_INTERNAL_DEFLATE)
include(FindPkgConfig)
pkg_check_modules(deflate IMPORTED_TARGET GLOBAL libdeflate)
set(CMAKE_IGNORE_PATH)
if (deflate_FOUND)
message(STATUS "Using libdeflate from ${deflate_LINK_LIBRARIES}")
endif()
endif()

if(NOT TARGET PkgConfig::deflate AND NOT deflate_FOUND)
Expand Down Expand Up @@ -216,7 +215,13 @@ if(NOT TARGET PkgConfig::deflate AND NOT deflate_FOUND)
set(EXR_DEFLATE_LIB)
else()
set(EXR_DEFLATE_INCLUDE_DIR)
set(EXR_DEFLATE_LIB PkgConfig::deflate)
set(EXR_DEFLATE_LIB ${deflate_LIBRARIES})
# set EXR_DEFATE_LDFLAGS for OpenEXR.pc.in for static build
if (BUILD_SHARED_LIBS)
set(EXR_DEFLATE_LDFLAGS "")
else()
set(EXR_DEFLATE_LDFLAGS "-l${deflate_LIBRARIES}")
endif()
set(EXR_DEFLATE_SOURCES)
endif()

Expand Down Expand Up @@ -253,6 +258,11 @@ if(NOT TARGET Imath::Imath AND NOT Imath_FOUND)
FetchContent_GetProperties(Imath)
if(NOT Imath_POPULATED)
FetchContent_Populate(Imath)

# Propagate OpenEXR's setting for pkg-config generation to Imath:
# If OpenEXR is generating it, the internal Imath should, too.
set(IMATH_INSTALL_PKG_CONFIG ${OPENEXR_INSTALL_PKG_CONFIG})

# hrm, cmake makes Imath lowercase for the properties (to imath)
add_subdirectory(${imath_SOURCE_DIR} ${imath_BINARY_DIR})
endif()
Expand Down
39 changes: 28 additions & 11 deletions share/ci/scripts/linux/validate_openexr_libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,42 @@ if [[ $# == "0" ]]; then
exit -1
fi

set -x

BUILD_ROOT=$1
SRC_ROOT=$2

# Locate OpenEXR.pc and set PKG_CONFIG_PATH accordingly

pkgconfig=$(find $BUILD_ROOT -name OpenEXR.pc)
pkgconfig=$(find $BUILD_ROOT -name OpenEXR.pc | head -1)

if [[ "$pkgconfig" == "" ]]; then
echo "Can't find OpenEXR.pc"
exit -1
fi

cat $pkgconfig

export PKG_CONFIG_PATH=$(dirname $pkgconfig)

# Build the validation program

CXX_FLAGS=$(pkg-config OpenEXR --cflags)
LD_FLAGS=$(pkg-config OpenEXR --libs --static)
CXX_FLAGS=$(env PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config OpenEXR --cflags)
LD_FLAGS=$(env PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config OpenEXR --libs --static)

VALIDATE_CPP=$(mktemp --tmpdir "validate_cpp_XXX.cpp")
VALIDATE_BIN=$(mktemp --tmpdir "validate_bin_XXX")
VALIDATE_BUILD=$(mktemp -d --tmpdir "validate_build_XXX")

VALIDATE_CPP=$(mktemp --tmpdir "validate_XXX.cpp")
VALIDATE_BIN=$(mktemp --tmpdir "validate_XXX")
trap "rm -rf $VALIDATE_CPP $VALIDATE_BIN" exit
trap "rm -rf $VALIDATE_CPP $VALIDATE_BIN $VALIDATE_BUILD" exit

echo -e '#include <ImfHeader.h>\n#include <OpenEXRConfig.h>\n#include <stdio.h>\nint main() { puts(OPENEXR_PACKAGE_STRING); Imf::Header h; return 0; }' > $VALIDATE_CPP

g++ $CXX_FLAGS $VALIDATE_CPP -o $VALIDATE_BIN $LD_FLAGS

# Execute the program

LIB_DIR=$(pkg-config OpenEXR --variable=libdir)
LIB_DIR=$(env PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config OpenEXR --variable=libdir)
export LD_LIBRARY_PATH=$LIB_DIR

validate=`$VALIDATE_BIN`
Expand All @@ -62,15 +70,15 @@ if [[ "$status" != "0" ]]; then
fi

# Get the suffix, e.g. -2_5_d, and determine if there's also a _d
libsuffix=$(pkg-config OpenEXR --variable=libsuffix)
libsuffix=$(env PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config OpenEXR --variable=libsuffix)
if [[ $libsuffix != $(basename ./$libsuffix _d) ]]; then
_d="_d"
else
_d=""
fi

# Validate each of the libs
libs=$(pkg-config OpenEXR --libs-only-l | sed -e s/-l//g)
libs=$(env PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config OpenEXR --libs-only-l | sed -e s/-l//g)
for lib in $libs; do

base=$(echo $lib | cut -d- -f1)
Expand Down Expand Up @@ -105,13 +113,22 @@ if [[ "$?" == "0" ]]; then
fi

if [[ "$SRC_ROOT" != "" ]]; then
version=$(pkg-config OpenEXR --modversion)
version=$(env PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config OpenEXR --modversion)
notes=$(grep "\* \[Version $version\]" $SRC_ROOT/CHANGES.md | head -1)
if [[ "$notes" == "" ]]; then
echo "No release notes."
else
echo "Release notes: $notes"
fi
fi



# Confirm that the example programs build, link, and run

cd $VALIDATE_BUILD

cmake -DCMAKE_PREFIX_PATH=$BUILD_ROOT $SRC_ROOT/src/examples
cmake --build .
./bin/OpenEXRExamples

echo "ok."
2 changes: 1 addition & 1 deletion src/bin/exrstdattr/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ getChromaticities (
if (i > argc - 9)
throw invalid_argument("Expected 8 chromaticity values");

ChromaticitiesAttribute* a = new ChromaticitiesAttribute;
ChromaticitiesAttribute* a = new ChromaticitiesAttribute(Chromaticities());
attrs.push_back (SetAttr (attrName, part, a));

a->value ().red.x = static_cast<float> (strtod (argv[i + 1], 0));
Expand Down
12 changes: 6 additions & 6 deletions src/examples/multipartExamples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void combineFiles ()

const char * filenames[] = {"gz1.exr", "tiledgz1.exr", "test.deep.exr", "testTiled.deep.exr"};

for (int i = 0; i < sizeof (filenames) / sizeof (filenames[0]); i++)
for (size_t i = 0; i < sizeof (filenames) / sizeof (filenames[0]); i++)
{
MultiPartInputFile * in_file = new MultiPartInputFile (filenames[i]);
Header header = in_file->header (0);
Expand All @@ -112,7 +112,7 @@ void combineFiles ()

MultiPartOutputFile outputFile ("multipart.exr", headers.data (), (int)headers.size ());

for (int i = 0; i < sizeof (filenames) / sizeof (filenames[0]); i++)
for (size_t i = 0; i < sizeof (filenames) / sizeof (filenames[0]); i++)
{
Header & header = headers[i];
const string& type = header.type ();
Expand Down Expand Up @@ -351,8 +351,8 @@ void modifyDeepChannels(Array2D<uint32_t> & sampleCount, list<Array2D<T *>> & ch
for (int x = 0; x < channel.width (); x++)
{
uint32_t count = sampleCount[y][x];
for (int j = 0; j < count; j++)
channel[y][x][j] += delta;
for (uint32_t j = 0; j < count; j++)
channel[y][x][j] += delta;
}
}
}
Expand Down Expand Up @@ -414,7 +414,7 @@ void modifyMultipart ()
Box2i dataWindow = header.dataWindow ();
OutputPart outputPart (outputFile, i);
outputPart.setFrameBuffer (frameBuffer);
outputPart.writePixels (header.dataWindow ().max.y - header.dataWindow ().min.y + 1);
outputPart.writePixels (dataWindow.max.y - dataWindow.min.y + 1);
}
else
{
Expand Down Expand Up @@ -466,7 +466,7 @@ void modifyMultipart ()
Box2i dataWindow = header.dataWindow ();
DeepScanLineOutputPart outputPart (outputFile, i);
outputPart.setFrameBuffer (frameBuffer);
outputPart.writePixels (header.dataWindow ().max.y - header.dataWindow ().min.y + 1);
outputPart.writePixels (dataWindow.max.y - dataWindow.min.y + 1);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/OpenEXRCore/encoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ default_compress_chunk (exr_encode_pipeline_t* encode)
return pctxt->print_error (
pctxt,
rv,
"error allocating buffer %lu",
"error allocating buffer %zu",
exr_compress_max_buffer_size (encode->packed_bytes));
//return rv;

Expand Down
4 changes: 2 additions & 2 deletions src/lib/OpenEXRCore/internal_cpuid.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#endif

#if OPENEXR_ENABLE_X86_SIMD_CHECK
# if defined(_MSC_VER) && defined(_WIN32)
# if defined(_WIN32)
# include <intrin.h>
# else
# include <cpuid.h>
Expand Down Expand Up @@ -51,7 +51,7 @@ check_for_x86_simd (int* f16c, int* avx, int* sse2)

#elif OPENEXR_ENABLE_X86_SIMD_CHECK

# if defined(_MSC_VER) && defined(_WIN32)
# if defined(_WIN32)
int regs[4]={0}, osxsave;

__cpuid (regs, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/OpenEXRCore/openexr_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

# define OPENEXR_VERSION_MAJOR 3
# define OPENEXR_VERSION_MINOR 2
# define OPENEXR_VERSION_PATCH 0
# define OPENEXR_VERSION_PATCH 1

#endif
5 changes: 5 additions & 0 deletions src/lib/OpenEXRCore/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,18 @@ exr_attr_string_set_with_length (
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable : 4996)
#elif __MSVCRT__ && __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wstringop-truncation"
#endif
if (d)
strncpy (sstr, d, (size_t) len);
else
memset (sstr, 0, (size_t) len);
#ifdef _MSC_VER
# pragma warning(pop)
#elif __MSVCRT__ && __GNUC__
#pragma GCC diagnostic pop
#endif
}
sstr[len] = '\0';
Expand Down
Loading
Loading