{"record":{"id":"a34bb416cef3ecaa","repo":"remotion-dev/remotion","slug":"invalid-lut-content-on-line-linenumber-lut-3d-size-must-be","errorCode":null,"errorMessage":"Invalid LUT content on line ${lineNumber}: LUT_3D_SIZE must be an integer from 2 to 256","messagePattern":"Invalid LUT content on line (.+?): LUT_3D_SIZE must be an integer from 2 to 256","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/lut/parse-cube-lut.ts","lineNumber":118,"sourceCode":"\t\t\t\tif (size !== null) {\n\t\t\t\t\tthrow new TypeError(\n\t\t\t\t\t\t`Invalid LUT content on line ${lineNumber}: LUT_3D_SIZE may only be declared once`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (values.length !== 1) {\n\t\t\t\t\tthrow new TypeError(\n\t\t\t\t\t\t`Invalid LUT content on line ${lineNumber}: LUT_3D_SIZE must contain exactly one integer`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst parsedSize = Number(values[0]);\n\t\t\t\tif (\n\t\t\t\t\t!Number.isInteger(parsedSize) ||\n\t\t\t\t\tparsedSize < 2 ||\n\t\t\t\t\tparsedSize > 256\n\t\t\t\t) {\n\t\t\t\t\tthrow new TypeError(\n\t\t\t\t\t\t`Invalid LUT content on line ${lineNumber}: LUT_3D_SIZE must be an integer from 2 to 256`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tsize = parsedSize;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (keyword === 'DOMAIN_MIN') {\n\t\t\t\tif (hasDomainMin) {\n\t\t\t\t\tthrow new TypeError(\n\t\t\t\t\t\t`Invalid LUT content on line ${lineNumber}: DOMAIN_MIN may only be declared once`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tdomainMin = parseTriplet({\n\t\t\t\t\tvalues,\n\t\t\t\t\tlineNumber,","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/effects/src/lut/parse-cube-lut.ts#L100-L136","documentation":"parseCubeLut() only accepts a LUT_3D_SIZE value that is an integer between 2 and 256 inclusive. Non-integers, values below 2 (a 1x1x1 grid is not a real LUT), and values above 256 are rejected to keep memory use and parsing sane.","triggerScenarios":"A .cube file declares e.g. 'LUT_3D_SIZE 1', 'LUT_3D_SIZE 0', 'LUT_3D_SIZE 512', 'LUT_3D_SIZE 33.5', or a non-numeric token like 'LUT_3D_SIZE auto'.","commonSituations":"Very high-resolution LUTs exported above the 256 limit, corrupted or placeholder size values, fractional sizes from a misconfigured exporter.","solutions":["Resample/downgrade the LUT to a size of 256 or below using a LUT tool (e.g. export at 32/64)","Correct the value to a valid integer between 2 and 256 whose cube equals your color-row count","Check whether your exporter has a resolution setting that exceeds 256 and lower it"],"exampleFix":"// before\nLUT_3D_SIZE 512\n// after\nLUT_3D_SIZE 256","handlingStrategy":"validation","validationCode":"const m = content.match(/^LUT_3D_SIZE\\s+(\\d+)\\s*$/m);\nif (!m) throw new Error('Missing LUT_3D_SIZE');\nconst size = Number(m[1]);\nif (!Number.isInteger(size) || size < 2 || size > 256) throw new Error(`Size ${size} out of range 2-256`);","typeGuard":"null","tryCatchPattern":"try {\n  const lut = parseCubeLut(content);\n} catch (e) {\n  if (e instanceof TypeError && e.message.includes('must be an integer from 2 to 256')) {\n    // resample the LUT to an allowed size, e.g. 32 or 64\n  } else throw e;\n}","preventionTips":["Export LUTs at standard sizes (2-256, commonly 17/32/64)","Clamp or resample oversized LUTs before parsing","Check exporter resolution settings"],"tags":["validation","lut","value-out-of-range"],"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"}