{"record":{"id":"84171484cd009158","repo":"BabylonJS/Babylon.js","slug":"unsupported-file-format","errorCode":null,"errorMessage":"Unsupported file format","messagePattern":"Unsupported file format","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/Materials/Textures/Loaders/EXR/exrLoader.header.ts","lineNumber":125,"sourceCode":"        const attributeName = ParseNullTerminatedString(dataView.buffer, offset);\r\n\r\n        if (!attributeName) {\r\n            keepReading = false;\r\n        } else {\r\n            const attributeType = ParseNullTerminatedString(dataView.buffer, offset);\r\n            const attributeSize = ParseUint32(dataView, offset);\r\n            const attributeValue = ParseValue(dataView, offset, attributeType, attributeSize);\r\n\r\n            if (attributeValue === undefined) {\r\n                Logger.Warn(`Unknown header attribute type ${attributeType}'.`);\r\n            } else {\r\n                headerData[attributeName] = attributeValue;\r\n            }\r\n        }\r\n    }\r\n\r\n    if ((specData & ~0x04) != 0) {\r\n        throw new Error(\"Unsupported file format\");\r\n    }\r\n\r\n    return { version: version, spec: spec, ...headerData };\r\n}\r\n","sourceCodeStart":107,"sourceCodeEnd":130,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/Materials/Textures/Loaders/EXR/exrLoader.header.ts#L107-L130","documentation":"After reading the EXR version bytes, GetExrHeader validates specData (byte 5, the version 'flags' field). Bit 0x02 (tiled) and 0x04 (long names / multi-part markers) are tolerated; any other flag bit set (e.g. 0x08 non-image/deep data or 0x10 multipart) means the file uses a format feature this parser cannot read, so it throws 'Unsupported file format'.","triggerScenarios":"Raised in GetExrHeader when (specData & ~0x04) != 0 — i.e. the EXR version field sets unsupported flags: deep/latent data files (flag 0x400/0x800 per OpenEXR spec bits beyond this parser's mask), or multipart (0x200) / deep (0x800) exports depending on the mask, while only single-part scanline/tiled simple files are supported.","commonSituations":"Deep compositing EXRs from Nuke/Houdini, multi-part EXRs combining beauty and AOV passes, or files written by newer OpenEXR libraries with extra version flags.","solutions":["Re-export as a single-part, scanline EXR without deep data or extra parts","Flatten the file with a converter: `oiiotool deep.exr --flatten -o flat.exr` or `exrmultipart -combine`","Check the file with exrheader to see the version flags (deep/multipart/tiled)","Split multi-part files into separate single-part EXRs before loading"],"exampleFix":"// before: multipart deep EXR from Nuke\n// after: flatten to a plain single-part scanline EXR\n// oiiotool multipart.exr --flatten --compression zip -o simple.exr","handlingStrategy":"validation","validationCode":"// EXR byte 5 holds version flags; this loader only tolerates tiled (0x200 is *not* the flag here) —\n// practically: reject deep/multipart files by checking flags beyond 0x04\nconst dv = new DataView(buf);\nconst flags = dv.getUint8(5);\nif ((flags & ~0x04) !== 0) throw new Error(\"EXR uses unsupported version flags (deep/multipart?) — flatten it first\");","typeGuard":"function isSimpleExrVariant(buf: ArrayBuffer): boolean {\n  if (buf.byteLength < 6) return false;\n  const flags = new DataView(buf).getUint8(5);\n  return (flags & ~0x04) === 0;\n}","tryCatchPattern":"try {\n  await loader.loadAsync(file);\n} catch (e) {\n  if (/Unsupported file format/.test(String(e))) {\n    console.warn(\"Deep/multipart EXR detected — flattening\");\n    return loadFlattenedExr(url);\n  }\n  throw e;\n}","preventionTips":["Configure Nuke/Houdini exports as single-part scanline, non-deep EXRs","Flatten deep EXRs with oiiotool --flatten before shipping to the web","Check version flags with exrheader during asset validation","Keep compositing-grade multi-part EXRs out of the texture pipeline"],"tags":["exr","version-flags","unsupported-format"],"backgroundTag":"unsupported-exr-file-variant","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}