Skip to content

Commit

Permalink
Do not write a CICP tag for gray color profiles
Browse files Browse the repository at this point in the history
The ICC version 4.4 specification states that the CICP tag is only
supported for RGB, YCbCr or XYZ color profiles.

Commit 9c9f559 modified the wrong
SetCICPTag call.
  • Loading branch information
0xC0000054 committed Nov 19, 2022
1 parent db1e5d5 commit 07d982a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/common/ColorProfileGeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ void SetIccProfileFromNclx(FormatRecord* formatRecord, const heif_color_profile_

if (profile)
{
SetCICPTag(profile.get(), primaries, transferCharacteristics, matrixCoefficients, fullRange);
SaveColorProfileToHandle(profile.get(), formatRecord);
}
}
Expand Down Expand Up @@ -412,12 +411,7 @@ void SetIccProfileFromNclx(FormatRecord* formatRecord, const heif_color_profile_

if (profile)
{
// The ICC version 4.4 specification states that the
// CICP tag is not supported for gray color profiles.
if (!IsMonochromeImage(formatRecord))
{
SetCICPTag(profile.get(), primaries, transferCharacteristics, matrixCoefficients, fullRange);
}
SetCICPTag(profile.get(), primaries, transferCharacteristics, matrixCoefficients, fullRange);
SaveColorProfileToHandle(profile.get(), formatRecord);
}
}
Expand Down

0 comments on commit 07d982a

Please sign in to comment.