Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon can not be set as Finder's Folder #54

Closed
akabekobeko opened this issue Apr 6, 2017 · 6 comments
Closed

Icon can not be set as Finder's Folder #54

akabekobeko opened this issue Apr 6, 2017 · 6 comments
Labels
Milestone

Comments

@akabekobeko
Copy link
Owner

Examine and fix the problem of #43 again.

@akabekobeko akabekobeko added this to the v1.0.8 milestone Apr 6, 2017
akabekobeko pushed a commit that referenced this issue Apr 6, 2017
@akabekobeko
Copy link
Owner Author

akabekobeko commented Apr 10, 2017

Safari's .icns file can be set in Finder's folder, so I will refer to this.

@akabekobeko
Copy link
Owner Author

Safari icon TOC is set. The type and length of the image are specified as TOC instead of individual headers, and then the images are connected.

byte type value
4 ascii "icns"
4 number Length (bytes) of file
4 ascii "TOC " ...Trim is necessary
4 number Length (bytes) of toc
4 ascii Name of icon type (ex: "ic10")
4 number Length (bytes) of icon image
... ... ...
* binary Image data (PNG, JPEG, ...etc)

@akabekobeko
Copy link
Owner Author

ICNS structure of app icon.

Firefox v52.0.2

OSType Length (Bytes)
is32 635
s8mk 264
il32 2412
l8mk 1032
it32 27872
t8mk 16392
ic08 73381
ic09 183844
ic10 495671

Safari v10.1 (12603.1.30.0.34)

It has a TOC and defines the type and length there.

OSType Length (Bytes)
is32 710
s8mk 264
il32 2440
l8mk 1032
ic07 24437
ic08 72437
ic09 223610
ic11 2726
ic12 8548
ic13 72437
ic14 223610
ic10 900891
is32 710

@akabekobeko
Copy link
Owner Author

akabekobeko commented Apr 11, 2017

Generate an icns file from the following image files with iconutil, the image file was renamed with icon-gen (svg2png) created.

Pixle Name
1024 icon_512x512@2x.png
512 icon_512x512.png
512 icon_256x256@2x.png
256 icon_256x256.png
256 icon_128x128@2x.png
128 icon_128x128.png
64 icon_32x32@2x.png
32 icon_32x32.png
32 icon_16x16@2x.png
16 icon_16x16.png

Structure of generated ICNS file.

OSType Length (Bytes)
ic09 43177
ic07 8988
ic12 4129
ic10 100541
ic14 43177
l8mk 1032
s8mk 264
ic08 19597
ic13 19597
ic11 1701
info 267
il32 1742
is32 615

TOC does not exist. However, types other than PNG are also stored.

@akabekobeko
Copy link
Owner Author

Reference documents when supporting formats other than PNG.

@akabekobeko akabekobeko changed the title Retina support PackBits support Apr 19, 2017
@akabekobeko akabekobeko changed the title PackBits support Icon can not be set as Finder's Folder Apr 20, 2017
@akabekobeko
Copy link
Owner Author

It was found that even if it does not correspond to PackBits, it can be corrected simply by skipping icp4, icp5, icp6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant