Skip to content

Commit

Permalink
Merge pull request #124 from luox-app/zain_bugs
Browse files Browse the repository at this point in the history
Issue while inserting File with manual values
  • Loading branch information
spitschan authored Apr 2, 2024
2 parents 63b657b + d36e320 commit 3caa692
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/javascript/tm30ColourFidelityIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ const floor10 = (value, exp) => decimalAdjust("floor", value, exp);
*/
export const getCESSummary = (Jabr, Jabt, deltaEi) => {
const cesSummary = {};
const newCESSummary = {};
let hi = 0;
let j = 0;

Expand Down Expand Up @@ -493,8 +494,25 @@ export const getCESSummary = (Jabr, Jabt, deltaEi) => {
cesSummary[j].testa.push(Jabt[i].aprime);
cesSummary[j].testb.push(Jabt[i].bprime);
});
let k = 1;
Object.keys(cesSummary).forEach((i) => {
if (
cesSummary[i].deltaEi.length > 0 &&
cesSummary[i].refJ.length > 0 &&
cesSummary[i].refa.length > 0 &&
cesSummary[i].refb.length > 0 &&
cesSummary[i].testJ.length > 0 &&
cesSummary[i].testa.length > 0 &&
cesSummary[i].testb.length > 0
) {
newCESSummary[k] = cesSummary[i];
k += 1;
} else {
binCount -= 1;
}
});

return cesSummary;
return newCESSummary;
};

/**
Expand Down

0 comments on commit 3caa692

Please sign in to comment.