From ec3f618bcadc4e2691e78c5865fa67da95b9cdab Mon Sep 17 00:00:00 2001 From: Emmanuel Deloget Date: Wed, 12 Feb 2025 13:04:45 +0100 Subject: [PATCH 1/2] fix: handle the table of content resource type correctly All ICNS resource type entries are made of a type and a length. The resource type is always a 4 byte string - if it's shorter than 4 bytes, it is filled with space (0x20) characters. This is also the case for the 'TOC ' resource type, so add the missing space character. Signed-off-by: Emmanuel Deloget --- pkg/icons/icns.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/icons/icns.go b/pkg/icons/icns.go index 2df57bd..fc6f0a0 100644 --- a/pkg/icons/icns.go +++ b/pkg/icons/icns.go @@ -168,7 +168,7 @@ func ReadIcns(reader *bufio.Reader) (map[string]SubImage, error) { imageDataLength := int(icon.Length) - 8 osType := string(icon.Type[:]) - if osType != "info" && osType != "TOC" && osType != "icnV" && osType != "name" { + if osType != "info" && osType != "TOC " && osType != "icnV" && osType != "name" { typeToImage[osType] = SubImage{ Offset: offset, Length: imageDataLength, From 0677dd92674e4ede7918d79abc35490d170c5879 Mon Sep 17 00:00:00 2001 From: Mike Maietta Date: Wed, 23 Apr 2025 15:21:59 -0700 Subject: [PATCH 2/2] Create curly-parents-peel.md --- .changeset/curly-parents-peel.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/curly-parents-peel.md diff --git a/.changeset/curly-parents-peel.md b/.changeset/curly-parents-peel.md new file mode 100644 index 0000000..9ef2f00 --- /dev/null +++ b/.changeset/curly-parents-peel.md @@ -0,0 +1,5 @@ +--- +"app-builder-bin": patch +--- + +fix: handle the table of content resource type correctly