Skip to content

Commit 4a13f4b

Browse files
authored
fix(exr): ACES container writes colorInteropId instead of colorInteropID (#4966)
The EXR reading code was correct. These attribute names are case sensitive in OpenEXR. Test output was updated. Signed-off-by: Brecht Van Lommel <[email protected]>
1 parent ed40859 commit 4a13f4b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/doc/builtinplugins.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,13 +1661,13 @@ control aspects of the writing itself:
16611661
- One of `none` (default), `strict`, or `relaxed`.
16621662
If not `none`, the spec will be checked to see if it is compliant
16631663
with the ACES Container format defined in `ST 2065-4`_. If it is,
1664-
`chromaticities` will be set to the ACES AP0 ones, `colorInteropId`
1664+
`chromaticities` will be set to the ACES AP0 ones, `colorInteropID`
16651665
will be set to 'lin_ap0_scene' and the `acesImageContainerFlag`
16661666
attribute will be set to 1.
16671667
In `strict` mode, if the spec is non-compliant, the output will
16681668
throw an error and avoid writing the image.
16691669
While in `relaxed` mode, if the spec is non-compliant, `chromaticities`
1670-
and `colorInteropId` will be set, but `acesImageContainerFlag`
1670+
and `colorInteropID` will be set, but `acesImageContainerFlag`
16711671
will NOT.
16721672
* - ``oiio:RawColor``
16731673
- int

src/openexr.imageio/exroutput.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ static constexpr float ACES_AP0_chromaticities[8] = {
299299
0.32168f, 0.33767f // white
300300
};
301301

302-
static const std::string ACES_AP0_colorInteropId = "lin_ap0_scene";
302+
static const std::string ACES_AP0_colorInteropID = "lin_ap0_scene";
303303

304304

305305
bool
@@ -407,10 +407,10 @@ is_aces_container_compliant(const OIIO::ImageSpec& spec, std::string& reason)
407407
}
408408

409409
// Check attributes with exact values if they exist
410-
if (spec.get_string_attribute("oiio:ColorSpace", ACES_AP0_colorInteropId)
411-
!= ACES_AP0_colorInteropId
412-
|| spec.get_string_attribute("colorInteropId", ACES_AP0_colorInteropId)
413-
!= ACES_AP0_colorInteropId) {
410+
if (spec.get_string_attribute("oiio:ColorSpace", ACES_AP0_colorInteropID)
411+
!= ACES_AP0_colorInteropID
412+
|| spec.get_string_attribute("colorInteropID", ACES_AP0_colorInteropID)
413+
!= ACES_AP0_colorInteropID) {
414414
reason
415415
= "Color space is not lin_ap0_scene as required for an ACES Container.";
416416
return false;
@@ -448,7 +448,7 @@ set_aces_container_attributes(OIIO::ImageSpec& spec)
448448
{
449449
spec.attribute("chromaticities", OIIO::TypeDesc(OIIO::TypeDesc::FLOAT, 8),
450450
ACES_AP0_chromaticities);
451-
spec.attribute("colorInteropId", ACES_AP0_colorInteropId);
451+
spec.attribute("colorInteropID", ACES_AP0_colorInteropID);
452452
spec.attribute("acesImageContainerFlag", 1);
453453
}
454454

testsuite/openexr-suite/ref/out.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ strict-out.exr : 4 x 4, 3 channel, half openexr
351351
channel list: R, G, B
352352
acesImageContainerFlag: 1
353353
chromaticities: 0.7347, 0.2653, 0, 1, 0.0001, -0.077, 0.32168, 0.33767
354-
colorInteropId: "lin_ap0_scene"
354+
colorInteropID: "lin_ap0_scene"
355355
compression: "none"
356356
PixelAspectRatio: 1
357357
screenWindowCenter: 0, 0

0 commit comments

Comments
 (0)