Skip to content

fix: handle the table of content resource type correctly#148

Merged
mmaietta merged 2 commits intodevelar:masterfrom
emmanuel-deloget:fix_toc_handling_in_icns
Apr 23, 2025
Merged

fix: handle the table of content resource type correctly#148
mmaietta merged 2 commits intodevelar:masterfrom
emmanuel-deloget:fix_toc_handling_in_icns

Conversation

@emmanuel-deloget
Copy link
Contributor

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.

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 <logout@free.fr>
@changeset-bot
Copy link

changeset-bot bot commented Feb 12, 2025

🦋 Changeset detected

Latest commit: 0677dd9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
app-builder-bin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@emmanuel-deloget
Copy link
Contributor Author

It should be noted that I had to implement this fix in order to be able to build our electron-based application, where our icons are stored in ICNS files for both our Linux and MacOS builds.

Modern ICNS tools often add a TOC\0x20 entry in the resource list, and that may not have been the case before. Add this to the fact that most linux-based builds are not based upon ICNS files and that should explain why this issue may not have been detected for 7 years (the fixed line was last changed in 2018).

@mmaietta mmaietta merged commit b3207cc into develar:master Apr 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants