iconset:错误:无法生成ICNS

时间:2015-07-26 00:09:46

标签: macos icns iconutil

我试图为应用程序制作一个iconset,但在我制作时仍然出错:Hexchat.iconset:error: Failed to generate ICNS.

我尝试从Illustrator单独导出.png文件,以及使用脚本。当前脚本的1024 x 1024 png文件为Hexchat_8.png

mkdir Hexchat.iconset
sips -z 16 16     Hexchat_8.png --out Hexchat.iconset/hexchat_16x16.png
sips -z 32 32     Hexchat_8.png --out Hexchat.iconset/hexchat_16x16@2x.png
sips -z 32 32     Hexchat_8.png --out Hexchat.iconset/hexchat_32x32.png
sips -z 64 64     Hexchat_8.png --out Hexchat.iconset/hexchat_32x32@2x.png
sips -z 128 128   Hexchat_8.png --out Hexchat.iconset/hexchat_128x128.png
sips -z 256 256   Hexchat_8.png --out Hexchat.iconset/hexchat_128x128@2x.png
sips -z 256 256   Hexchat_8.png --out Hexchat.iconset/hexchat_256x256.png
sips -z 512 512   Hexchat_8.png --out Hexchat.iconset/hexchat_256x256@2x.png
sips -z 512 512   Hexchat_8.png --out Hexchat.iconset/hexchat_512x512.png
cp Hexchat_8.png Hexchat.iconset/hexchat_512x512@2x.png
iconutil -c icns Hexchat.iconset
rm -R Hexchat.iconset

每次都是相同的,有或没有输出文件:

iconutil -c icns Hexchat.iconset
Hexchat.iconset:error: Failed to generate ICNS.

iconutil -c icns Hexchat.iconset -o hexchat.icns
Hexchat.iconset:error: Failed to generate ICNS.

chmod&和/或sudo不起作用,并且手册页显示没有详细错误输出的选项。我做错了什么?

1 个答案:

答案 0 :(得分:2)

就我而言,当我尝试存档时,mac osx app会出现此错误。命名惯例

icon_16x16.png icon_16x16@2x.png icon_32x32.png icon_32x32@2x.png icon_128x128.png icon_128x128@2x.png icon_256x256.png icon_256x256@2x.png icon_512x512.png icon_512x512@2x.png

是正确的,但我发现我的图标的alpha = NO。我使用 alpha = Yes 再次导出图像,并修复了错误。