Skip to content

fix(color mgmt): More sensible OCIO file rules#5194

Open
lgritz wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-exrfilerule
Open

fix(color mgmt): More sensible OCIO file rules#5194
lgritz wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-exrfilerule

Conversation

@lgritz
Copy link
Copy Markdown
Collaborator

@lgritz lgritz commented May 14, 2026

I recently discovered that OCIO's built-in configs' "file rules" that come into play when using getColorSpaceFromFilepath actually do not incorporate the search for color space name embedded in the filename into the logic, and moreover, assume that files ending in ".exr" are ACES2065-1, of all things. This seems an unfortunate choice because in the real world, almost no exr files people will encounter actually use the ap0 primaries.

This PR does the following to shore up this and related edge cases:

  • For OCIO built-in configs, fully replace the existing file rules with a blank slate that just uses the path parsing rule. Everything else is categorized as "unknown". (Though many of our format readers already do something better, setting the metadata if they actually know what the file is.)

  • Recognize "unknown" as equivalent to having an empty color space, an error if you pass such a color space name to IBA color transform functions.

  • For all IBA color conversion, if the input space is not color managed, be sure NOT TO mark the output color space as the original to request! Input raw means output is also raw.

Oh dear, a recent discovery: OCIO's built-in configs' "file rules"
that come into play when using getColorSpaceFromFilepath actually does
not incorporate the search for color space name embedded in the
filename into the logic, and moreover, assume that files ending in
".exr" are ACES2065-1, of all things.  This seems an unfortunate
choice because in the real world, almost no exr files people will
encounter actually use the ap0 primaries.

This PR does the following to shore up this and related edge cases:

* For OCIO built-in configs, fully replace the existing file rules
  with a blank slate that just uses the path parsing rule. Everything
  else is categorized as "unknown". (Though many of our format readers
  already do something better, setting the metdata if they actually
  know what the file is.)

* Recognize "unknown" is equivalent to having an empty color space,
  an error if you pass such a color space name to IBA color transform
  functions.

* For all IBA color conversion, if the input space is not color
  managed, be sure NOT TO mark the output color space as the original
  `to` request! Input raw means output is also raw.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
@lgritz lgritz requested a review from zachlewis May 14, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant