Also invert if target_colorspace, which means - always invert source display/view if we have any target colorspace or a display/view that differs from the source display/view

This commit is contained in:
Roy Nieterau 2025-12-10 00:38:49 +01:00
parent f0e603fe7c
commit b1be956994

View file

@ -1234,16 +1234,6 @@ def oiio_color_convert(
if source_view and source_display: if source_view and source_display:
color_convert_args = None color_convert_args = None
ocio_display_args = None ocio_display_args = None
if source_display != target_display or source_view != target_view:
# Undo source display/view if we have a source display/view
# that does not match the target display/view
oiio_cmd.extend([
"--ociodisplay:inverse=1:subimages=0",
source_display,
source_view,
])
if target_colorspace: if target_colorspace:
# This is a two-step conversion process since there's no direct # This is a two-step conversion process since there's no direct
# display/view to colorspace command # display/view to colorspace command
@ -1260,6 +1250,15 @@ def oiio_color_convert(
" No color conversion needed." " No color conversion needed."
) )
if color_convert_args or ocio_display_args:
# Invert source display/view so that we can go from there to the
# target colorspace or display/view
oiio_cmd.extend([
"--ociodisplay:inverse=1:subimages=0",
source_display,
source_view,
])
if color_convert_args: if color_convert_args:
# Use colorconvert for colorspace target # Use colorconvert for colorspace target
oiio_cmd.extend([ oiio_cmd.extend([