{"record":{"id":"d872b6f1caa65dda","repo":"BabylonJS/Babylon.js","slug":"compressioncodes-header-compression-is-unsuppo","errorCode":null,"errorMessage":"${CompressionCodes[header.compression]} is unsupported","messagePattern":"(.+?) is unsupported","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/Materials/Textures/Loaders/EXR/exrLoader.decoder.ts","lineNumber":150,"sourceCode":"        case CompressionCodes.ZIP_COMPRESSION:\r\n            decoder.lines = 16;\r\n            decoder.uncompress = UncompressZIP;\r\n            await Tools.LoadScriptAsync(ExrLoaderGlobalConfiguration.FFLATEUrl);\r\n            break;\r\n\r\n        case CompressionCodes.PIZ_COMPRESSION:\r\n            decoder.lines = 32;\r\n            decoder.uncompress = UncompressPIZ;\r\n            break;\r\n\r\n        case CompressionCodes.PXR24_COMPRESSION:\r\n            decoder.lines = 16;\r\n            decoder.uncompress = UncompressPXR;\r\n            await Tools.LoadScriptAsync(ExrLoaderGlobalConfiguration.FFLATEUrl);\r\n            break;\r\n\r\n        default:\r\n            throw new Error(CompressionCodes[header.compression] + \" is unsupported\");\r\n    }\r\n\r\n    decoder.scanlineBlockSize = decoder.lines;\r\n\r\n    const channels: {\r\n        [key: string]: boolean;\r\n    } = {};\r\n    for (const channel of header.channels) {\r\n        switch (channel.name) {\r\n            case \"R\":\r\n            case \"G\":\r\n            case \"B\":\r\n            case \"A\":\r\n                channels[channel.name] = true;\r\n                decoder.type = channel.pixelType;\r\n                break;\r\n            case \"Y\":\r\n                channels[channel.name] = true;\r","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/Materials/Textures/Loaders/EXR/exrLoader.decoder.ts#L132-L168","documentation":"CreateDecoderAsync switches on the EXR header's compression code. Only NO/RLE/ZIPS/ZIP/PIZ/PXR24 are implemented; anything else (e.g. B44, B44A, DWAA, DWBA) hits the default branch and throws with the compression's name. The loader simply does not support that compression method yet.","triggerScenarios":"Raised in CreateDecoderAsync (called by loadData) when header.compression maps to an unimplemented CompressionCodes entry — typically loading a modern EXR exported with DWAA/DWBA lossy compression or B44.","commonSituations":"Textures exported from recent DCC tools (Houdini, Nuke, ARNold) defaulting to DWAA; EXRs transcoded with lossy compression for size; older library versions lacking newer codecs.","solutions":["Re-export the EXR with ZIP, ZIPS, RLE, PIZ or PXR24 compression","Convert the file with a tool (e.g. `oiiotool in.exr -d half -o --compression zip out.exr`) to a supported codec","Update the Babylon.js package to the latest version in case the codec was added","Check header.compression value with exrheader to know which codec the file uses"],"exampleFix":"// before (DWAA, unsupported)\n// oiiotool scene.exr -o scene_dwaa.exr\n// after: re-export with a supported compression\n// oiiotool scene.exr --compression zip -o scene.exr","handlingStrategy":"fallback","validationCode":"// detect compression code from header before loading: byte 8 of an EXR is compression\n// only accept 0 (NO), 1 (RLE), 3 (ZIPS), 4 (ZIP), 5 (PIZ) or 7 (PXR24)\nconst dv = new DataView(buf);\nconst compression = dv.getUint8(8);\nconst supported = [0, 1, 3, 4, 5, 7];\nif (!supported.includes(compression)) throw new Error(\"EXR compression \" + compression + \" unsupported, re-export with ZIP\");","typeGuard":"function hasSupportedExrCompression(buf: ArrayBuffer): boolean {\n  if (buf.byteLength < 9) return false;\n  const c = new DataView(buf).getUint8(8);\n  return [0, 1, 3, 4, 5, 7].includes(c);\n}","tryCatchPattern":"try {\n  await loader.loadAsync(file);\n} catch (e) {\n  if (/is unsupported$/.test(String(e)) && /COMPRESSION/.test(String(e))) {\n    return loadTranscodedExr(url); // pre-converted ZIP version\n  }\n  throw e;\n}","preventionTips":["Standardize exporter settings on ZIP or RLE compression","Batch-check compression codes in CI with exrheader","Keep pre-converted fallback assets for DWAA/B44 sources","Update the Babylon.js package when new codecs are needed"],"tags":["exr","unsupported-compression","format-compatibility"],"backgroundTag":"unsupported-exr-compression","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}