From 70ffd7107490400a6d4d5f9a595e8e0b95e60c91 Mon Sep 17 00:00:00 2001 From: Ye-hyoung Kang Date: Sat, 9 Jul 2022 18:06:50 +0900 Subject: [PATCH] fix: ALI block 'cinf' has diffent size for PSB AdditionalLayerInfo ("ALI") blocks with the 'cinf' key use different byte length for the size field; PSD files use 4 bytes and PSB files use 8. This is undocumented in Adobe's docs. Note that this bug previously did not cause parsing to fail, because our library ignores unrecognized ALI blocks. However, it _may_ have prevented recognizing valid ALI blocks that come after a 'cinf' block. --- .../LayerAndMaskInformation/AdditionalLayerInfo/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/psd/src/sections/LayerAndMaskInformation/AdditionalLayerInfo/index.ts b/packages/psd/src/sections/LayerAndMaskInformation/AdditionalLayerInfo/index.ts index c534ad6..032199b 100644 --- a/packages/psd/src/sections/LayerAndMaskInformation/AdditionalLayerInfo/index.ts +++ b/packages/psd/src/sections/LayerAndMaskInformation/AdditionalLayerInfo/index.ts @@ -96,6 +96,7 @@ function getAliLengthFieldSizeType( case "FEid": case "FXid": case "PxSD": + case "cinf": // Undocumented in Adobe's docs return "u64"; } }