{"record":{"id":"3b9bff0656eebce0","repo":"remotion-dev/remotion","slug":"conflicting-lut-input-range-headers","errorCode":null,"errorMessage":"Conflicting LUT input range headers.","messagePattern":"Conflicting LUT input range headers\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio/src/helpers/cube-lut.ts","lineNumber":153,"sourceCode":"\tif (domainMin.some((min, channel) => min >= domainMax[channel])) {\n\t\tthrow new Error(\n\t\t\t'DOMAIN_MAX must be greater than DOMAIN_MIN in every channel.',\n\t\t);\n\t}\n\n\tif (\n\t\tdomainMin.some((min, channel) => !Number.isFinite(domainMax[channel] - min))\n\t) {\n\t\tthrow new Error('LUT input ranges must be finite.');\n\t}\n\n\tif (\n\t\t(headers.has('LUT_1D_INPUT_RANGE') || headers.has('LUT_3D_INPUT_RANGE')) &&\n\t\t(headers.has('DOMAIN_MIN') ||\n\t\t\theaders.has('DOMAIN_MAX') ||\n\t\t\theaders.has(type === '1d' ? 'LUT_3D_INPUT_RANGE' : 'LUT_1D_INPUT_RANGE'))\n\t) {\n\t\tthrow new Error('Conflicting LUT input range headers.');\n\t}\n\n\treturn {type, size, title, domainMin, domainMax, data};\n};\n\nexport const applyCubeLut = (pixels: Uint8ClampedArray, lut: CubeLut): void => {\n\tconst {data, size, domainMin, domainMax, type} = lut;\n\tconst last = size - 1;\n\tconst range = domainMin.map((min, channel) => domainMax[channel] - min);\n\n\tfor (let pixel = 0; pixel < pixels.length; pixel += 4) {\n\t\tif (type === '1d') {\n\t\t\tfor (let channel = 0; channel < 3; channel++) {\n\t\t\t\tconst position = Math.max(\n\t\t\t\t\t0,\n\t\t\t\t\tMath.min(\n\t\t\t\t\t\tlast,\n\t\t\t\t\t\t((pixels[pixel + channel] / 255 - domainMin[channel]) /","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/studio/src/helpers/cube-lut.ts#L135-L171","documentation":"A .cube file may specify its input domain either via LUT_1D_INPUT_RANGE / LUT_3D_INPUT_RANGE or via DOMAIN_MIN/DOMAIN_MAX — not both, and not mismatched 1D/3D range headers. When the parser sees an INPUT_RANGE header together with DOMAIN_MIN, DOMAIN_MAX, or the range header of the other LUT type, the intended domain is ambiguous, so it throws. This check runs after the whole file is scanned using the set of observed headers.","triggerScenarios":"parseCubeLut(text) on a file containing e.g. both 'LUT_3D_INPUT_RANGE 0 1' and 'DOMAIN_MIN 0 0 0'; both 'LUT_1D_INPUT_RANGE' and 'LUT_3D_INPUT_RANGE'; or an INPUT_RANGE plus DOMAIN_MAX in the same file.","commonSituations":"Merging headers from two LUT files; tools that emit both the legacy INPUT_RANGE and the newer DOMAIN_* headers; hand-editing that added a domain header without removing the input-range line.","solutions":["Delete either the INPUT_RANGE line or the DOMAIN_MIN/DOMAIN_MAX lines — keep exactly one domain specification.","If both a 1D and 3D INPUT_RANGE are present, remove the one that does not match the declared LUT_*_SIZE type.","Normalize the file with a converter that strips duplicate domain headers.","Pre-scan headers in code and reject mixed domain specs before parsing."],"exampleFix":"// before\nLUT_3D_INPUT_RANGE 0.0 1.0\nDOMAIN_MIN 0.0 0.0 0.0\nDOMAIN_MAX 1.0 1.0 1.0\n// after\nDOMAIN_MIN 0.0 0.0 0.0\nDOMAIN_MAX 1.0 1.0 1.0","handlingStrategy":"validation","validationCode":"const headers = new Set(\n  text.split(/\\r?\\n/)\n    .map((l) => l.trim().split(/\\s+/)[0])\n    .filter((kw) => /^[A-Z][A-Z0-9_]*$/.test(kw)),\n);\nconst hasRange = headers.has('LUT_1D_INPUT_RANGE') || headers.has('LUT_3D_INPUT_RANGE');\nif (hasRange && (headers.has('DOMAIN_MIN') || headers.has('DOMAIN_MAX'))) {\n  throw new Error('Both INPUT_RANGE and DOMAIN_* headers present');\n}","typeGuard":null,"tryCatchPattern":"try {\n  const lut = parseCubeLut(text);\n} catch (e) {\n  if (/Conflicting/.test((e as Error).message)) {\n    console.error('Keep exactly one domain spec: INPUT_RANGE or DOMAIN_MIN/MAX');\n  }\n}","preventionTips":["Standardize on DOMAIN_MIN/DOMAIN_MAX (or INPUT_RANGE) across your LUT library","Never merge headers from two different .cube files","Sanitize imports to strip duplicated domain headers"],"tags":["lut","validation","conflict"],"backgroundTag":"conflicting-config-options","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"}