Bug 1250461. Don't reject profiles with negative colorant tristiumlus value on macOS. r=mstange

This is basically just this: https://bugs.chromium.org/p/chromium/issues/detail?id=562951
The original profile that caused us to add this check has bigger problems than negative
colorant tristiumlus values. We should reject it using a better metric. In the mean time
let's not reject these things on macOS.
This commit is contained in:
Jeff Muizelaar 2017-10-12 11:46:08 -04:00
parent 19eb46db0d
commit d057c6f505

View File

@ -295,17 +295,6 @@ qcms_bool qcms_profile_is_bogus(qcms_profile *profile)
bY = s15Fixed16Number_to_float(profile->blueColorant.Y);
bZ = s15Fixed16Number_to_float(profile->blueColorant.Z);
// Check if any of the XYZ values are negative (see mozilla bug 498245)
// CIEXYZ tristimulus values cannot be negative according to the spec.
negative =
(rX < 0) || (rY < 0) || (rZ < 0) ||
(gX < 0) || (gY < 0) || (gZ < 0) ||
(bX < 0) || (bY < 0) || (bZ < 0);
if (negative)
return true;
// Sum the values; they should add up to something close to white
sum[0] = rX + gX + bX;
sum[1] = rY + gY + bY;
@ -331,6 +320,28 @@ qcms_bool qcms_profile_is_bogus(qcms_profile *profile)
return true;
}
#ifndef __APPLE__
// Check if any of the XYZ values are negative (see mozilla bug 498245)
// CIEXYZ tristimulus values cannot be negative according to the spec.
negative =
(rX < 0) || (rY < 0) || (rZ < 0) ||
(gX < 0) || (gY < 0) || (gZ < 0) ||
(bX < 0) || (bY < 0) || (bZ < 0);
#else
// Chromatic adaption to D50 can result in negative XYZ, but the white
// point D50 tolerance test has passed. Accept negative values herein.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=498245#c18 onwards
// for discussion about whether profile XYZ can or cannot be negative,
// per the spec. Also the https://bugzil.la/450923 user report.
// FIXME: allow this relaxation on all ports?
negative = false;
#endif
if (negative)
return true; // bogus
// All Good
return false;
}