Handle missing colorspace from display and view - #1983
Open
jakubjezek001 wants to merge 1 commit into
Open
Conversation
If 'colorspace' is missing from colorspaceData, fall back to a combination of 'display' and 'view' or just 'view'.
jakubjezek001
marked this pull request as ready for review
August 5, 2026 09:44
iLLiCiTiT
reviewed
Aug 5, 2026
Comment on lines
625
to
637
| if repre.get("colorspaceData"): | ||
| colorspace = repre["colorspaceData"]["colorspace"] | ||
| colorspace = repre["colorspaceData"].get("colorspace") | ||
| display = repre["colorspaceData"].get("display") | ||
| view = repre["colorspaceData"].get("view") | ||
| if not colorspace and (display and view): | ||
| colorspace = f"{display}_{view}" | ||
| elif not colorspace and not display and view: | ||
| colorspace = view | ||
| # replace spaces with underscores | ||
| # pipeline.colorspace.parse_colorspace_from_filepath | ||
| # is checking it with underscores too | ||
| colorspace = colorspace.replace(" ", "_") | ||
| template_data["colorspace"] = colorspace |
Member
There was a problem hiding this comment.
Suggested change
| repre_colorspace_data = repre.get("colorspaceData") | |
| if repre_colorspace_data: | |
| colorspace = repre_colorspace_data.get("colorspace") | |
| if not colorspace: | |
| display = repre_colorspace_data.get("display") | |
| view = repre_colorspace_data.get("view") | |
| if display and view: | |
| colorspace = f"{display}_{view}" | |
| elif view: | |
| colorspace = view | |
| # replace spaces with underscores | |
| # pipeline.colorspace.parse_colorspace_from_filepath | |
| # is checking it with underscores too | |
| if colorspace: | |
| colorspace = colorspace.replace(" ", "_") |
Member
|
This is incorrect, right? As far as I know we can't just assume display+view is also settable as colorspace. Display/View != Colorspace. |
Member
|
If this is needed then we should require to also fill And actually this is good question. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Derive the colorspace template value from
displayandviewwhencolorspaceis unavailable, with aview-only fallback.Testing
ideally test with ynput/ayon-nuke#347