This commit is contained in:
Shawn Wilsher 2008-11-28 11:02:21 -08:00
Родитель f7b26097a5 02c8178e12
Коммит 7d443b2dff
4 изменённых файлов: 4 добавлений и 51 удалений

Просмотреть файл

@ -598,6 +598,10 @@ gfxPlatform::GetCMSOutputProfile()
getter_Copies(fname));
if (NS_SUCCEEDED(rv) && !fname.IsEmpty()) {
gCMSOutputProfile = cmsOpenProfileFromFile(fname, "r");
if (gCMSOutputProfile)
fprintf(stderr,
"ICM profile read from %s successfully\n",
fname.get());
}
}
}
@ -607,15 +611,6 @@ gfxPlatform::GetCMSOutputProfile()
gfxPlatform::GetPlatform()->GetPlatformCMSOutputProfile();
}
/* Determine if the profile looks bogus. If so, close the profile
* and use sRGB instead. See bug 460629, */
if (gCMSOutputProfile && cmsProfileIsBogus(gCMSOutputProfile)) {
NS_ASSERTION(gCMSOutputProfile != GetCMSsRGBProfile(),
"Builtin sRGB profile tagged as bogus!!!");
cmsCloseProfile(gCMSOutputProfile);
gCMSOutputProfile = nsnull;
}
if (!gCMSOutputProfile) {
gCMSOutputProfile = GetCMSsRGBProfile();
}

Просмотреть файл

@ -855,7 +855,6 @@ LCMSAPI LPcmsCIExyY LCMSEXPORT cmsD50_xyY(void);
LCMSAPI cmsHPROFILE LCMSEXPORT cmsOpenProfileFromFile(const char *ICCProfile, const char *sAccess);
LCMSAPI cmsHPROFILE LCMSEXPORT cmsOpenProfileFromMem(LPVOID MemPtr, DWORD dwSize);
LCMSAPI LCMSBOOL LCMSEXPORT cmsCloseProfile(cmsHPROFILE hProfile);
LCMSAPI LCMSBOOL LCMSEXPORT cmsProfileIsBogus(cmsHPROFILE hProfile);
// Predefined run-time profiles

Просмотреть файл

@ -2523,47 +2523,7 @@ cmsHPROFILE LCMSEXPORT cmsOpenProfileFromMem(LPVOID MemPtr, DWORD dwSize)
}
// Checks a profile for obvious inconsistencies and returns
// TRUE if the profile looks bogus and should probably be
// ignored.
LCMSBOOL LCMSEXPORT cmsProfileIsBogus(cmsHPROFILE hProfile)
{
cmsCIEXYZTRIPLE primaries;
VEC3 sum, target, tolerance;
unsigned i;
// Read the primaries
cmsTakeColorants(&primaries, hProfile);
// Sum the values
sum.n[0] = primaries.Red.X + primaries.Green.X + primaries.Blue.X;
sum.n[1] = primaries.Red.Y + primaries.Green.Y + primaries.Blue.Y;
sum.n[2] = primaries.Red.Z + primaries.Green.Z + primaries.Blue.Z;
// Build our target vector (see mozilla bug 460629)
target.n[0] = 0.96420;
target.n[1] = 1.00000;
target.n[2] = 0.82491;
// Our tolerance vector - Recommended by Chris Murphy based on
// conversion from the LAB space criterion of no more than 3 in any one
// channel. This is similar to, but slightly more tolerant than Adobe's
// criterion.
tolerance.n[0] = 0.02;
tolerance.n[1] = 0.02;
tolerance.n[2] = 0.04;
// Compare with our tolerance
for (i = 0; i < 3; ++i) {
if (!(((sum.n[i] - tolerance.n[i]) <= target.n[i]) &&
((sum.n[i] + tolerance.n[i]) >= target.n[i])))
return TRUE;
}
// All Good
return FALSE;
}
LCMSBOOL LCMSEXPORT cmsCloseProfile(cmsHPROFILE hProfile)
{

Просмотреть файл

@ -10,7 +10,6 @@ EXPORTS
cmsSmoothGamma = cmsSmoothGamma
cmsBuildRGB2XYZtransferMatrix= cmsBuildRGB2XYZtransferMatrix
cmsPrecacheProfile = cmsPrecacheProfile
cmsProfileIsBogus = cmsProfileIsBogus
cmsCloseProfile = cmsCloseProfile
cmsCreateProofingTransform = cmsCreateProofingTransform
cmsCreateRGBProfile = cmsCreateRGBProfile