summaryrefslogtreecommitdiff
path: root/src/cmsio1.c
diff options
context:
space:
mode:
authorMarti Maria <info@littlecms.com>2010-05-28 15:53:51 +0200
committerMarti Maria <info@littlecms.com>2010-05-28 15:53:51 +0200
commit1cff024fdbe91539839a46d830081da78775f419 (patch)
tree044c14c0d77fd3a697e43ad1644eb3b157e2b7f1 /src/cmsio1.c
parent96c149005d21a79dcb2ed7b2106827ebe918d663 (diff)
downloadlcms2-1cff024fdbe91539839a46d830081da78775f419.tar.gz
Trilinear interpolation
Diffstat (limited to 'src/cmsio1.c')
-rw-r--r--src/cmsio1.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/cmsio1.c b/src/cmsio1.c
index c367627..4035a47 100644
--- a/src/cmsio1.c
+++ b/src/cmsio1.c
@@ -439,12 +439,12 @@ cmsPipeline* _cmsReadOutputLUT(cmsHPROFILE hProfile, int Intent)
// The profile owns the Lut, so we need to copy it
Lut = cmsPipelineDup(Lut);
+ if (Lut == NULL) return NULL;
// Now it is time for a controversial stuff. I found that for 3D LUTS using
- // Lab used as indexer space, trilinear interpolation should be used
-
- if (cmsGetPCS(hProfile) == cmsSigLabData)
- ChangeInterpolationToTrilinear(Lut);
+ // Lab used as indexer space, trilinear interpolation should be used
+ if (cmsGetPCS(hProfile) == cmsSigLabData)
+ ChangeInterpolationToTrilinear(Lut);
// We need to adjust data only for Lab and Lut16 type
if (OriginalType != cmsSigLut16Type || cmsGetPCS(hProfile) != cmsSigLabData)
@@ -507,6 +507,12 @@ cmsPipeline* _cmsReadDevicelinkLUT(cmsHPROFILE hProfile, int Intent)
// The profile owns the Lut, so we need to copy it
Lut = cmsPipelineDup(Lut);
+ if (Lut == NULL) return NULL;
+
+ // Now it is time for a controversial stuff. I found that for 3D LUTS using
+ // Lab used as indexer space, trilinear interpolation should be used
+ if (cmsGetColorSpace(hProfile) == cmsSigLabData)
+ ChangeInterpolationToTrilinear(Lut);
// After reading it, we have info about the original type
OriginalType = _cmsGetTagTrueType(hProfile, tag16);