Preserve order when making unique to avoid error on R,G,B becoming B,G,R but the channels being using in R,G,B order in --ch argument

This commit is contained in:
Roy Nieterau 2025-11-11 16:46:04 +01:00
parent f38a6dffba
commit e2c6687690

View file

@ -1545,7 +1545,8 @@ def get_oiio_input_and_channel_args(oiio_input_info, alpha_default=None):
channels_arg += ",A={}".format(float(alpha_default))
input_channels.append("A")
input_channels_str = ",".join(set(input_channels))
# Make sure channels are unique, but preserve order to avoid oiiotool crash
input_channels_str = ",".join(list(dict.fromkeys(input_channels)))
subimages = oiio_input_info.get("subimages")
input_arg = "-i"