{"record":{"id":"864424ddf56face5","repo":"remotion-dev/remotion","slug":"invalid-lut-content-domain-min-must-be-smaller-than-domain","errorCode":null,"errorMessage":"Invalid LUT content: DOMAIN_MIN must be smaller than DOMAIN_MAX for every channel","messagePattern":"Invalid LUT content: DOMAIN_MIN must be smaller than DOMAIN_MAX for every channel","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/lut/parse-cube-lut.ts","lineNumber":192,"sourceCode":"\t\t});\n\t\tdataStarted = true;\n\t\tdataRows++;\n\n\t\tconst maxDataRows = size ** 3;\n\t\tif (dataRows > maxDataRows) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`Invalid LUT content: expected ${maxDataRows} color rows for LUT_3D_SIZE ${size}, but got more`,\n\t\t\t);\n\t\t}\n\t}\n\n\tif (size === null) {\n\t\tthrow new TypeError('Invalid LUT content: LUT_3D_SIZE is missing');\n\t}\n\n\tfor (let channel = 0; channel < 3; channel++) {\n\t\tif (domainMin[channel] >= domainMax[channel]) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`Invalid LUT content: DOMAIN_MIN must be smaller than DOMAIN_MAX for every channel`,\n\t\t\t);\n\t\t}\n\t}\n\n\tconst expectedRows = size ** 3;\n\tif (dataRows !== expectedRows) {\n\t\tthrow new TypeError(\n\t\t\t`Invalid LUT content: expected ${expectedRows} color rows for LUT_3D_SIZE ${size}, but got ${dataRows}`,\n\t\t);\n\t}\n\n\tconst data = new Float32Array(expectedRows * 4);\n\tlet dataIndex = 0;\n\n\tfor (let index = 0; index < lines.length; index++) {\n\t\tconst line = stripComment(lines[index]).trim();\n\t\tif (line.length === 0) {","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/effects/src/lut/parse-cube-lut.ts#L174-L210","documentation":"After parsing the header, parseCubeLut() validates that for all three channels DOMAIN_MIN < DOMAIN_MAX (defaults 0/1). If any channel has a min equal to or greater than its max, the LUT domain is inverted or degenerate and cannot be interpreted, so a TypeError is thrown.","triggerScenarios":"Calling parseCubeLut(content) on a .cube file whose `DOMAIN_MIN` / `DOMAIN_MAX` triplets are inverted (e.g. DOMAIN_MAX 0.0 0.0 0.0 and DOMAIN_MIN 1.0 1.0 1.0), equal (DOMAIN_MIN == DOMAIN_MAX on any channel), or where only one of the two directives was hand-edited.","commonSituations":"Corrupted or hand-edited .cube files, LUTs exported from tools with wrong domain settings, concatenating header lines from different LUTs, or typos swapping MIN and MAX values.","solutions":["Open the .cube file and ensure every DOMAIN_MAX value is strictly greater than the corresponding DOMAIN_MIN value","If the domain lines look wrong, delete DOMAIN_MIN/DOMAIN_MAX entirely — the parser defaults to [0,0,0]/[1,1,1]","Re-export the LUT from the original grading/color tool with default domain settings","Validate the header with a quick script before parsing (compare min/max per channel)"],"exampleFix":"// before (.cube header)\nDOMAIN_MIN 0.0 0.0 0.0\nDOMAIN_MAX 0.0 0.0 0.0\n// after\nDOMAIN_MIN 0.0 0.0 0.0\nDOMAIN_MAX 1.0 1.0 1.0","handlingStrategy":"validation","validationCode":"const lines = content.split(/\\r?\\n/).map((l) => l.split('#')[0].trim());\nconst min = lines.find((l) => l.startsWith('DOMAIN_MIN'));\nconst max = lines.find((l) => l.startsWith('DOMAIN_MAX'));\nif (min && max) {\n  const mins = min.split(/\\s+/).slice(1).map(Number);\n  const maxs = max.split(/\\s+/).slice(1).map(Number);\n  if (mins.some((m, i) => m >= maxs[i])) throw new Error('DOMAIN_MIN must be < DOMAIN_MAX');\n}","typeGuard":null,"tryCatchPattern":"try {\n  lut = parseCubeLut(content);\n} catch (e) {\n  if (e instanceof TypeError && e.message.includes('DOMAIN_MIN')) {\n    console.error('LUT domain settings are inverted or equal; fix DOMAIN_MIN/DOMAIN_MAX or remove them');\n  }\n  throw e;\n}","preventionTips":["Never hand-edit DOMAIN_MIN/DOMAIN_MAX without re-checking min < max per channel","Remove both domain lines entirely to get the safe 0..1 defaults","Re-export LUTs from the original tool instead of patching them"],"tags":["lut","validation","file-format"],"backgroundTag":"value-out-of-range","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"}