The current code simply adopts the first nclx property of the
gainmap item. The right behavior seems to be to fail if there are
multiple nclx properties (similar to what we do for the color image
and the tonemap image).
HEIF Section 6.5.5.1:
When two ColourInformationBoxes are associated with an image
item, one shall have a colour_type value of 'rICC' or 'prof'
(providing either restricted or unrestricted ICC profiles
respectively) and the other one shall have a colour_type value of
'nclx' with colour_primaries equal to 2 and
transfer_characteristics equal to 2 (2 indicating "unspecified",
since these data are supplied by the ICC profile instead).
The current code simply adopts the first nclx property of the gainmap item. The right behavior seems to be to fail if there are multiple nclx properties (similar to what we do for the color image and the tonemap image).
HEIF Section 6.5.5.1: