From d36e320bc70d2e78e2fda4ec9f54a737516bca25 Mon Sep 17 00:00:00 2001 From: Zain Ali Date: Tue, 2 Apr 2024 19:47:28 +0200 Subject: [PATCH] Issue while inserting File with manual values --- src/javascript/tm30ColourFidelityIndex.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/javascript/tm30ColourFidelityIndex.js b/src/javascript/tm30ColourFidelityIndex.js index e654fa5..041d01e 100644 --- a/src/javascript/tm30ColourFidelityIndex.js +++ b/src/javascript/tm30ColourFidelityIndex.js @@ -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; @@ -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; }; /**