File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -101,13 +101,26 @@ def generate_idt_urn(
101101 -------
102102 :class:`str`
103103 The generated URN in the format described.
104+
105+ Notes
106+ -----
107+ - Dots in the colorspace_vendor, encoding_colourspace, and
108+ encoding_transfer_function strings are replaced with underscores to
109+ ensure valid URN format, as dots are used as delimiters in the URN.
104110 """
105111
112+ # Sanitize input strings by replacing dots with underscores
113+ colorspace_vendor_clean = colorspace_vendor .replace ("." , "_" )
114+ encoding_colourspace_clean = encoding_colourspace .replace ("." , "_" )
115+ encoding_transfer_function_clean = encoding_transfer_function .replace ("." , "_" )
116+
106117 urn_prefix = ACES_URN_PREFIX .format (aces_transform_type = AcesTransformType .CSC .value )
107118 hash_id = generate_truncated_hash ()
108- colorspace_name = f"{ encoding_colourspace } _{ encoding_transfer_function } _{ hash_id } "
119+ colorspace_name = (
120+ f"{ encoding_colourspace_clean } _{ encoding_transfer_function_clean } _{ hash_id } "
121+ )
109122 return (
110- f"{ urn_prefix } .{ colorspace_vendor } .{ colorspace_name } .a{ ACES_MAJOR_VERSION } "
123+ f"{ urn_prefix } .{ colorspace_vendor_clean } .{ colorspace_name } .a{ ACES_MAJOR_VERSION } "
111124 f".v{ version_number } "
112125 )
113126
You can’t perform that action at this time.
0 commit comments