{"record":{"id":"892fb94ca4aa1aff","repo":"remotion-dev/remotion","slug":"keyword-must-contain-an-increasing-input-range","errorCode":null,"errorMessage":"${keyword} must contain an increasing input range.","messagePattern":"(.+?) must contain an increasing input range\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio/src/helpers/cube-lut.ts","lineNumber":91,"sourceCode":"\t\t\t\tthrow new Error(`${keyword} must contain three finite numbers.`);\n\t\t\t}\n\n\t\t\tif (keyword === 'DOMAIN_MIN') {\n\t\t\t\tdomainMin = [numbers[0], numbers[1], numbers[2]];\n\t\t\t} else {\n\t\t\t\tdomainMax = [numbers[0], numbers[1], numbers[2]];\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (keyword === 'LUT_1D_INPUT_RANGE' || keyword === 'LUT_3D_INPUT_RANGE') {\n\t\t\tif (\n\t\t\t\tnumbers.length !== 2 ||\n\t\t\t\t!numbers.every(Number.isFinite) ||\n\t\t\t\tnumbers[0] >= numbers[1]\n\t\t\t) {\n\t\t\t\tthrow new Error(`${keyword} must contain an increasing input range.`);\n\t\t\t}\n\n\t\t\tdomainMin = [numbers[0], numbers[0], numbers[0]];\n\t\t\tdomainMax = [numbers[1], numbers[1], numbers[1]];\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (isHeader) {\n\t\t\tthrow new Error(\n\t\t\t\t`Unsupported LUT header \"${keyword}\" on line ${index + 1}.`,\n\t\t\t);\n\t\t}\n\n\t\tif (data === null) {\n\t\t\tthrow new Error('Expected LUT_1D_SIZE or LUT_3D_SIZE before color data.');\n\t\t}\n\n\t\tconst color = [Number(keyword), ...numbers];","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/studio/src/helpers/cube-lut.ts#L73-L109","documentation":"parseCubeLut validates the LUT_1D_INPUT_RANGE / LUT_3D_INPUT_RANGE header of an Adobe .cube file. This header must contain exactly two finite numbers where the first (minimum) is strictly less than the second (maximum), since it defines the input domain of the LUT. The parser throws when the value count is wrong, a value is non-finite (NaN/Infinity), or min >= max, because a non-increasing range would divide by zero or invert the lookup domain in applyCubeLut.","triggerScenarios":"Calling parseCubeLut(text) on a .cube string whose INPUT_RANGE line has 0, 1, 3+ values, contains NaN/Infinity (e.g. 'LUT_1D_INPUT_RANGE 0 NaN'), or lists bounds in decreasing/equal order (e.g. 'LUT_3D_INPUT_RANGE 1 0' or '0 0').","commonSituations":"Hand-edited or corrupted .cube exports; LUT files generated by scripts with locale-swapped decimal separators producing NaN; files truncated mid-header; tools that write the range as 'max min' by mistake.","solutions":["Fix the INPUT_RANGE line so it has exactly two finite numbers with min < max, e.g. 'LUT_1D_INPUT_RANGE 0.0 1.0'.","Remove the INPUT_RANGE header entirely to fall back to the default domain [0,1].","If generating .cube files programmatically, validate the range before emitting it.","Wrap parseCubeLut in try/catch and surface a user-facing message pointing at the offending header."],"exampleFix":"// before\nLUT_3D_INPUT_RANGE 1.0 0.0\n// after\nLUT_3D_INPUT_RANGE 0.0 1.0","handlingStrategy":"validation","validationCode":"const rangeLine = text.split(/\\r?\\n/).find((l) => /^(LUT_1D|LUT_3D)_INPUT_RANGE\\b/.test(l.trim()));\nif (rangeLine) {\n  const nums = rangeLine.trim().split(/\\s+/).slice(1).map(Number);\n  if (nums.length !== 2 || !nums.every(Number.isFinite) || nums[0] >= nums[1]) {\n    throw new Error(`Invalid input range: ${rangeLine}`);\n  }\n}","typeGuard":"const isValidRange = (nums: number[]): boolean =>\n  nums.length === 2 && nums.every(Number.isFinite) && nums[0] < nums[1];","tryCatchPattern":"let lut;\ntry {\n  lut = parseCubeLut(text);\n} catch (e) {\n  throw new Error(`Could not load .cube LUT: ${(e as Error).message}`);\n}","preventionTips":["Keep INPUT_RANGE as exactly 'min max' with min < max and finite values","Prefer omitting the header to use the default [0,1] domain when unsure","Validate generated .cube files in CI with parseCubeLut"],"tags":["parsing","lut","validation"],"backgroundTag":"invalid-argument-value","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"}