Currently the OCIO File Rules are only based on the path string for the media. This was done intentionally since dealing with file format metadata was deemed too complex for the first pass at the feature. However, it's definitely the case that there often is metadata in the file header that could be useful for determining what the appropriate color space is and it would be useful for the File Rules to be able to leverage it.
We do not want to add any dependencies for file format libraries on to OCIO to support this feature, so it needs to be implemented in such a way that the host application parses the files and provides the metadata in some neutral representation, such as a pair of field & value strings. OpenImageIO has some techniques for representing file-format agnostic metadata that might be a good model for how this could work (without adding a dependency on OIIO).
Of course the metadata in file headers is often wrong, so there needs to be sufficient control in the File Rules to control the relative precedence of what is in the file relative to the existing path-based rules.
I think this overlaps with #1975 which is looking at the 'export' side of the problem, at least in the form of their needing to be a set of well known names and meanings for the metadata.
Currently the OCIO File Rules are only based on the path string for the media. This was done intentionally since dealing with file format metadata was deemed too complex for the first pass at the feature. However, it's definitely the case that there often is metadata in the file header that could be useful for determining what the appropriate color space is and it would be useful for the File Rules to be able to leverage it.
We do not want to add any dependencies for file format libraries on to OCIO to support this feature, so it needs to be implemented in such a way that the host application parses the files and provides the metadata in some neutral representation, such as a pair of field & value strings. OpenImageIO has some techniques for representing file-format agnostic metadata that might be a good model for how this could work (without adding a dependency on OIIO).
Of course the metadata in file headers is often wrong, so there needs to be sufficient control in the File Rules to control the relative precedence of what is in the file relative to the existing path-based rules.
Here is a presentation that discussed OpenEXR that is related.