macos - 图标集 :error: Failed to generate ICNS

标签 macos icns iconutil

我正在尝试为应用程序制作图标集,但制作时不断出现错误:Hexchat.iconset:error: 无法生成 ICNS。

我尝试从 Illustrator 中单独导出 .png 文件,也尝试使用脚本。当前脚本的 1024x1024 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'ing 和/或 sudo 不起作用,并且手册页没有显示详细错误输出的选项。我做错了什么?

最佳答案

将文件名从 hexchat_16x16.png 更改为 icon_16x16.png,所有其他尺寸均相同。

我刚刚遇到了同样的错误,名称类似于 myappicon16x16.png 并且无法理解为什么失败。

我很乐意因为发现了这一点而受到赞扬,但在看到你的问题后,我发现了这个 StackOverflow answer .

关于macos - 图标集 :error: Failed to generate ICNS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31632304/

相关文章:

macos - 调用 TransformProcessType() 时,应用程序菜单不显示

swift - NSTextField:将 String 转换为 Int 在 Xcode 外部中止(nil)

java - 在 macOS High Sierra 上使用 javapackager 找不到 icns 文件错误

macos - 以编程方式从 1024 * 1024 大小的 NSImage 创建图标 (ICNS)

xcode - iconutil 不适用于 macOS High Sierra

xcode - 如何使用 iconutil 手动创建 icns 文件?

macos - 在 macOS 中使用 WKWebView 加载 URL

objective-c - 如何以编程方式创建 ICNS 图标?

macos - iconutil错误: "Unsupported image format"

c - 为什么我在 netstat/ifconfig 中看不到服务器正在运行?