Skip to content

Commit

Permalink
Recover a fix lost in the last revert
Browse files Browse the repository at this point in the history
Fix CSA creation on linear gamma RGB spaces on RGB
  • Loading branch information
mm2 committed Sep 17, 2023
1 parent 8c23dbe commit 3a13a3f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/cmsps2.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,16 @@ void Emit1Gamma(cmsIOHANDLER* m, cmsToneCurve* Table)
cmsUInt32Number i;
cmsFloat64Number gamma;

if (Table == NULL) return; // Error

if (Table ->nEntries <= 0) return; // Empty table

// Suppress whole if identity
if (cmsIsToneCurveLinear(Table)) return;
/**
* On error, empty tables or lienar assume gamma 1.0
*/
if (Table == NULL ||
Table->nEntries <= 0 ||
cmsIsToneCurveLinear(Table)) {

_cmsIOPrintf(m, "{ 1 } bind ");
}


// Check if is really an exponential. If so, emit "exp"
gamma = cmsEstimateGamma(Table, 0.001);
Expand Down

0 comments on commit 3a13a3f

Please sign in to comment.