OpenColorIO icon indicating copy to clipboard operation
OpenColorIO copied to clipboard

File rules documentation config snippet incorrect

Open dyscalculia94 opened this issue 3 years ago • 2 comments

Hi all,

I've been reading about file rules and decided to modify the ACES 1.2 config to include the file rules from OCIO documentation:

files_rules:
  - !<Rule> {name: LogC, extension: "*", pattern: "*LogC*", colorspace: ARRI LogC}
  - !<Rule> {name: OpenEXR, extension: "exr", pattern: "*", colorspace: ACEScg}
  - !<Rule> {name: TIFF, regex: ".*\.TIF?F$", colorspace: sRGB}
  - !<Rule> {name: ColorSpaceNamePathSearch}
  - !<Rule> {name: Default, colorspace: default}

I've also changed the config version to v2, since that config is v1.

However, after using ociocheck on that config I've discovered that there are two problems with it:

  1. Typo: files_rules instead of file_rules
  2. Error because of the unknown escape character : . This one I fixed by deleting the backslash (\) from the TIFF rule.

I was thinking of submitting a pull request to fix this. Is this something that should be fixed via pull request or is it something that OCIO devs would fix internally, since it's a really small and simple fix?

dyscalculia94 avatar Jul 29 '22 16:07 dyscalculia94

  • Error because of the unknown escape character : . This one I fixed by deleting the backslash (\) from the TIFF rule

If the intention is to represent a literal . dot before the extension, I think we might actually need to add a second backslash to escape YAML's own parsing of the backslash character: ".*\\.TIF?F$"

zachlewis avatar Aug 18 '22 23:08 zachlewis

Yes, you're probably right. That's probably supposed to match files with the .TIF extension, as well as other similar to that.

dyscalculia94 avatar Aug 19 '22 17:08 dyscalculia94

Closing as fixed by PR #1738.

doug-walker avatar Jan 04 '23 21:01 doug-walker