{"record":{"id":"efa9c03d411e7e7f","repo":"remotion-dev/remotion","slug":"invalid-lut-content-on-line-linenumber-label-must-contain","errorCode":null,"errorMessage":"Invalid LUT content on line ${lineNumber}: ${label} must contain exactly 3 numbers","messagePattern":"Invalid LUT content on line (.+?): (.+?) must contain exactly 3 numbers","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/lut/parse-cube-lut.ts","lineNumber":33,"sourceCode":"\t\t} else if (character === '#' && !insideQuotes) {\n\t\t\treturn line.slice(0, i);\n\t\t}\n\t}\n\n\treturn line;\n};\n\nconst parseTriplet = ({\n\tvalues,\n\tlineNumber,\n\tlabel,\n}: {\n\treadonly values: readonly string[];\n\treadonly lineNumber: number;\n\treadonly label: string;\n}): readonly [number, number, number] => {\n\tif (values.length !== 3) {\n\t\tthrow new TypeError(\n\t\t\t`Invalid LUT content on line ${lineNumber}: ${label} must contain exactly 3 numbers`,\n\t\t);\n\t}\n\n\tconst parsed = values.map((value) => Number(value));\n\tif (parsed.some((value) => !Number.isFinite(value))) {\n\t\tthrow new TypeError(\n\t\t\t`Invalid LUT content on line ${lineNumber}: ${label} must contain only finite numbers`,\n\t\t);\n\t}\n\n\treturn [parsed[0], parsed[1], parsed[2]];\n};\n\nconst HEADER_DIRECTIVES = new Set([\n\t'TITLE',\n\t'LUT_3D_SIZE',\n\t'DOMAIN_MIN',","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/effects/src/lut/parse-cube-lut.ts#L15-L51","documentation":"parseTriplet() is used by parseCubeLut to convert each RGB data line of a .cube file into a [red, green, blue] tuple. When a data line does not split into exactly 3 whitespace-separated numbers, a TypeError is thrown identifying the line number and the label (e.g. the LUT_3D_SIZE directive or a data row). .cube data rows must always contain exactly R G B values.","triggerScenarios":"A .cube file with malformed data rows: extra values per line (e.g. RGB+alpha), values merged without whitespace ('0.50.5 0.5 0.5'), comma-separated values ('0.1,0.2,0.3'), or lines with only one or two columns.","commonSituations":"Hand-edited or truncated .cube files; LUTs exported from tools using a locale-dependent decimal comma; copy-paste corruption turning tabs/newlines into odd whitespace; files with a trailing label line misread as data.","solutions":["Open the .cube file at the reported line number and fix or remove the malformed row","Re-export the LUT from the original grading tool in standard .cube format","Replace commas with spaces and ensure values are space-separated","Validate the file with a .cube linter/parser before passing it to the effect"],"exampleFix":"// before: comma-separated values inside the .cube file\n0.1,0.2,0.3\n// after: standard .cube data line (3 space-separated numbers)\n0.1 0.2 0.3","handlingStrategy":"validation","validationCode":"const dataLines = cubeText.split('\\n').filter((l) => l && !l.startsWith('#') && /^\\s*[\\d.-]/.test(l));\nconst bad = dataLines.findIndex((l) => l.trim().split(/\\s+/).length !== 3);\nif (bad !== -1) {\n  throw new Error(`.cube data line ${bad + 1} does not have exactly 3 numbers`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  const lut = parseCubeLut(cubeText);\n} catch (e) {\n  if (e instanceof TypeError && e.message.includes('must contain exactly 3 numbers')) {\n    // surface e.message (includes line number) to the user for fixing the .cube file\n  }\n}","preventionTips":["Validate .cube files with a parser before adding them to the project","Never hand-edit .cube data rows; re-export from the grading tool","Use spaces (not commas or tabs) between values","Run files through a linter that checks 3-values-per-row"],"tags":["lut","cube-format","parsing","validation"],"backgroundTag":"invalid-argument-format","analyzedSha":"46a3a6bf13ca367376ff18bbb06dae2e87e0d068","analyzedAt":"2026-09-18T00:12:20.256Z","contentChangedAt":"2026-09-18T00:12:20.256Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}