{"record":{"id":"c0eb7ccbccee1a5a","repo":"heygen-com/hyperframes","slug":"mixed-1d-and-3d-cube-luts-are-not-supported-yet","errorCode":null,"errorMessage":"Mixed 1D and 3D cube LUTs are not supported yet","messagePattern":"Mixed 1D and 3D cube LUTs are not supported yet","errorType":"validation","errorClass":"CubeLutParseError","httpStatus":null,"severity":"error","filePath":"packages/core/src/colorLuts.ts","lineNumber":173,"sourceCode":"    }\n    if (!lut3dSize) {\n      if (lut1dSize) {\n        throw new CubeLutParseError(\"1D cube LUTs are not supported yet\", lineNumber);\n      }\n      throw new CubeLutParseError(\"LUT data appears before LUT_3D_SIZE\", lineNumber);\n    }\n    if (parts.length !== 3) {\n      throw new CubeLutParseError(\"LUT data rows must contain three numbers\", lineNumber);\n    }\n    rows.push(\n      parseFiniteNumber(parts[0]!, lineNumber),\n      parseFiniteNumber(parts[1]!, lineNumber),\n      parseFiniteNumber(parts[2]!, lineNumber),\n    );\n  }\n\n  if (lut1dSize && lut3dSize) {\n    throw new CubeLutParseError(\"Mixed 1D and 3D cube LUTs are not supported yet\");\n  }\n  if (!lut3dSize) {\n    if (lut1dSize) throw new CubeLutParseError(\"1D cube LUTs are not supported yet\");\n    throw new CubeLutParseError(\"Missing LUT_3D_SIZE\");\n  }\n  validateDomain(domainMin, domainMax);\n\n  const expectedRows = lut3dSize * lut3dSize * lut3dSize;\n  if (rows.length !== expectedRows * 3) {\n    throw new CubeLutParseError(\n      `Expected ${expectedRows} LUT rows for size ${lut3dSize}, found ${rows.length / 3}`,\n    );\n  }\n\n  return {\n    title,\n    size: lut3dSize,\n    domainMin,","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/heygen-com/hyperframes/blob/c2996c8626135db5253519359d8a063d3bafad8d/packages/core/src/colorLuts.ts#L155-L191","documentation":"A .cube file that declares both LUT_1D_SIZE and LUT_3D_SIZE is ambiguous — the format does not define a combined 1D+3D LUT in a single file. The throw at line 173 fires after the loop when both sizes were set, regardless of whether data rows followed.","triggerScenarios":"A single file containing both a 'LUT_1D_SIZE N' line and a 'LUT_3D_SIZE M' line anywhere in the header.","commonSituations":"Concatenating a 1D shaper LUT and a 3D look LUT into one file; a hand-edit that left both headers in place.","solutions":["Split the file into two separate .cube files (one 1D, one 3D) and apply them in sequence in your pipeline.","Delete whichever header is unwanted.","Re-export from the source tool, which writes one LUT type per file."],"exampleFix":"// before\nLUT_1D_SIZE 4\nLUT_3D_SIZE 2\n...\n\n// after — keep only the 3D section\nLUT_3D_SIZE 2\n...","handlingStrategy":"try-catch","validationCode":"function assertSingleLutType(fileText: string): void {\n  const has1D = /^LUT_1D_SIZE/m.test(fileText);\n  const has3D = /^LUT_3D_SIZE/m.test(fileText);\n  if (has1D && has3D) throw new Error('File declares both 1D and 3D sizes; split into two files');\n}","typeGuard":null,"tryCatchPattern":"try {\n  parseCubeLut(fileText);\n} catch (err) {\n  if (err instanceof CubeLutParseError && /Mixed 1D and 3D/.test(err.message)) {\n    // split the file at the second LUT_*_SIZE header and handle each separately\n  } else throw err;\n}","preventionTips":["Keep one LUT type per .cube file.","Apply 1D shaper + 3D look as separate files in your pipeline.","Re-export from the source tool, which writes one type per file."],"tags":["lut","cube","unsupported","parsing"],"backgroundTag":null,"analyzedSha":"c2996c8626135db5253519359d8a063d3bafad8d","analyzedAt":"2026-08-12T22:18:56.877Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}