当我验证我的应用时,我收到此错误:
应用程序包不包含ICNS格式的图标,同时包含
512x512
和512x512@2x
图像。
我用Img2icns应用程序制作icns图标,直到今天它始终正常工作。但现在我收到了这个错误,没有办法让它发挥作用。我尝试将两个PNG文件(512x512
和1024x1024
)放在Img2icns中,但我总是得到错误。我也尝试按照Apple的OS X人机界面指南中的说明进行操作,但是当我尝试制作图标集时,我收到此终端错误:
-bash:意外标记'换行符'附近的语法错误
我对终端命令不是很好,所以也许我做错了。我写道:
iconutil -c icns </Users/myname/SDK Mac Apps/MyApp/grafica/icon.iconset>
如果有人能提供帮助,我们将非常感激。谢谢,马西。
答案 0 :(得分:238)
这是一个将1024x1024 png(名为“Icon1024.png”)转换为所需icns文件的脚本。将它保存到png文件所在文件夹中名为“CreateICNS.src”的文件夹中,然后将“cd”发送到同一文件夹并输入“source CreateICNS.src”来调用它:
mkdir MyIcon.iconset
sips -z 16 16 Icon1024.png --out MyIcon.iconset/icon_16x16.png
sips -z 32 32 Icon1024.png --out MyIcon.iconset/icon_16x16@2x.png
sips -z 32 32 Icon1024.png --out MyIcon.iconset/icon_32x32.png
sips -z 64 64 Icon1024.png --out MyIcon.iconset/icon_32x32@2x.png
sips -z 128 128 Icon1024.png --out MyIcon.iconset/icon_128x128.png
sips -z 256 256 Icon1024.png --out MyIcon.iconset/icon_128x128@2x.png
sips -z 256 256 Icon1024.png --out MyIcon.iconset/icon_256x256.png
sips -z 512 512 Icon1024.png --out MyIcon.iconset/icon_256x256@2x.png
sips -z 512 512 Icon1024.png --out MyIcon.iconset/icon_512x512.png
cp Icon1024.png MyIcon.iconset/icon_512x512@2x.png
iconutil -c icns MyIcon.iconset
rm -R MyIcon.iconset
答案 1 :(得分:56)
查看以下说明(link):
使用iconutil手动创建icns文件
iconutil
命令行工具将iconset
个文件夹转换为可部署的高分辨率icns文件。 (您可以在终端中输入man iconutil
来查找此工具的完整文档。)使用此工具还会压缩生成的icns
文件,因此您无需执行其他压缩。将一组图标转换为icns文件
在终端窗口中输入此命令:
iconutil -c icns <iconset filename>
其中
<iconset filename>
是包含您要转换为icns
的图标集的文件夹的路径。输出将写入与iconset file
相同的位置,除非您指定输出文件,如下所示:
iconutil -c icns -o <icon filename> <iconset filename>
换句话说,您需要将<iconset filename>
替换为路径:
/Users/myname/SDK Mac Apps/MyApp/grafica/icon.iconset
由于路径包含空格,因此您需要使用双引号,例如:
iconutil -c icns "/Users/myname/SDK Mac Apps/MyApp/grafica/icon.iconset"
此命令应该可以正常工作。
答案 2 :(得分:18)
有一个命令行节点模块,可以完成将PNG文件转换为iconset目录的所有工作:
npm install -g node-icns
nicns --in adventure-cat.png --out adventure-cat.icns
答案 3 :(得分:12)
这些命令(在终端中输入)对我来说可以将旧的icns文件转换为新格式:
cd Folder_With_Icns_File
iconutil -c iconset Your_Icon_Name.icns
rm Your_Icon_Name.icns
iconutil -c icns Your_Icon_Name.iconset
rm -R Your_Icon_Name.iconset
不再支持iconutil的-c
参数。请改用--convert
:
cd Folder_With_Icns_File
iconutil --convert iconset Your_Icon_Name.icns
rm Your_Icon_Name.icns
iconutil --convert icns Your_Icon_Name.iconset
rm -R Your_Icon_Name.iconset
答案 4 :(得分:11)
虽然使用各种脚本将高分辨率PNG
图像转换为多种不同的低分辨率副本可能看起来很方便(而且确实如此),但是不应该忘记这种自动调整大小的方法渲染出明显不完美的图像。
分辨率越低,图标就越模糊!
相反,您应该始终从设计师那里以某种矢量格式请求徽标,例如SVG
。有了这个,您可以手动准备所有所需分辨率的完美PNG文件,然后制作一个.icns
文件,这将使您的应用程序图标在每个屏幕上看起来都很漂亮,从手机到一些高端的Retina显示最新的iMac。
从2016年起的最新Apple guideline,您应该准备以下PNG文件:
+---------------------+--------------------+--------------+
| filename | resolution, pixels | density, PPI |
+---------------------+--------------------+--------------+
| icon_16x16.png | 16x16 | 72 |
| icon_16x16@2x.png | 32x32 | 144 |
| icon_32x32.png | 32x32 | 72 |
| icon_32x32@2x.png | 64x64 | 144 |
| icon_128x128.png | 128x128 | 72 |
| icon_128x128@2x.png | 256x256 | 144 |
| icon_256x256.png | 256x256 | 72 |
| icon_256x256@2x.png | 512x512 | 144 |
| icon_512x512.png | 512x512 | 72 |
| icon_512x512@2x.png | 1024x1024 | 144 |
+---------------------+--------------------+--------------+
准备完所有PNG文件后,将它们放入某个扩展名为.iconset
的目录(例如Logos.iconset
),然后从终端执行以下操作:
iconutil --convert icns Logos.iconset
如果在执行此命令后没有错误,那么所有文件都已正确处理,并且您在同一目录中获得了Logos.icns
文件,其中包含适合您的应用程序的所有美丽的清晰徽标屏幕截至2017年。
答案 5 :(得分:8)
附加注释,当您创建 .icns文件时,您需要使用前缀“icon _ ”重命名所有图片文件,否则,iconutil将失败并显示错误消息:“。imlset:error:Failed生成ICNS。“根本没有提供信息。
答案 6 :(得分:5)
我重构了@ Henry的剧本以使其看起来更好:
-c
<强>更新强>
不再支持iconutil的-—convert
参数。请改用#!/bin/zsh
NAME=$(basename $1 .png); DIR="$NAME.iconset"
mkdir -pv $DIR
for m r in 'n' '' '((n+1))' '@2x'; do
for n in $(seq 4 9 | grep -v 6); do
p=$((2**$m)); q=$((2**$n))
OUT="$DIR/icon_${q}x${q}${r}.png"
sips -z $p $p $1 --out $OUT
done
done
iconutil -—convert icns $DIR
rm -frv $DIR
:
<form class="form-group" ng-submit="submitConsent()">
<label for="" ng-repeat="relation in relationships">
<input type="checkbox" name="ids" value="{{relation.id}}"/>
{{relation.name}} ({{ relation.role }})<br/>
</label>
<input type="submit" name="Submit Questionnaire" />
</form>
答案 7 :(得分:5)
我编写了一个bash脚本,用于从svg文件中创建icns:
#!/usr/bin/env bash
sizes=(16 32 64 128 256 512)
largfile='icon_512x512@2x.png'
if [ ! -f "$largfile" ]; then
convert -background none -resize 1024x1024 "$1" "$largfile"
fi
for s in "${sizes[@]}"; do
echo $s
convert -background none -resize ${s}x${s} "$largfile" "icon_${s}x$s.png"
done
cp 'icon_32x32.png' 'icon_16x16@2x.png'
mv 'icon_64x64.png' 'icon_32x32@2x.png'
cp 'icon_256x256.png' 'icon_128x128@2x.png'
cp 'icon_512x512.png' 'icon_256x256@2x.png'
mkdir icon.iconset
mv icon_*x*.png icon.iconset
iconutil -c icns icon.iconset
确保在mac:
上安装了librsvg支持的imagemagickbrew install imagemagick --with-librsvg
这个脚本对我很有帮助。
为了更彻底的处理,我创建了一个命令行工具(用Swift编写),用于生成具有正确布局和格式的AppIcon.appiconset
:
答案 8 :(得分:4)
更多信息: http://eon.codes/blog/2016/12/06/Creating-an-app-icon/
高sierra更新 iconutil
现在对源.png大小更加严格。跳转后的博客文章中有关于此的更多信息。 ✌️
答案 9 :(得分:3)
当我验证我的应用时,我收到此错误:
应用程序包不包含ICNS格式的图标,包含512x512和512x512 @ 2x图像。
⋮
我对终端命令不是很好,所以也许我做错了。我写道:
iconutil -c icns </Users/myname/SDK Mac Apps/MyApp/grafica/icon.iconset>
首先,正如我在评论Anne的回答中提到的那样,你可能不需要使用iconutil。您应该只需将iconset添加到项目中,并让Xcode在构建过程中为您转换它。
无论哪种方式,这可能是你的问题:
我尝试将两个PNG文件放到一起(512x512和1024x1024)......但我总是得到错误。
没有1024 x 1024点大小。 The 1024 by 1024 pixel element (which was 1024 points before Mountain Lion) is now used for 512 by 512 points @2x.
您的PNG文件必须正确命名:icon_512x512@2x.png
答案 10 :(得分:3)
与@Henry相同(上面的注释),但将PNG文件名作为参数并输出具有相同名称的ICNS。
注意: PNG文件名只能有1个单独的扩展名,即xpto.png。
因此,请将下面的代码保存到png文件所在文件夹中名为“CreateICNS.src”的字段中。
代码:
IFS='.' read -ra ADDR <<< "$1"
ICONSET=${ADDR[0]}.iconset
mkdir $ICONSET
sips -z 16 16 $1 --out $ICONSET/icon_16x16.png
sips -z 32 32 $1 --out $ICONSET/icon_16x16@2x.png
sips -z 32 32 $1 --out $ICONSET/icon_32x32.png
sips -z 64 64 $1 --out $ICONSET/icon_32x32@2x.png
sips -z 128 128 $1 --out $ICONSET/icon_128x128.png
sips -z 256 256 $1 --out $ICONSET/icon_128x128@2x.png
sips -z 256 256 $1 --out $ICONSET/icon_256x256.png
sips -z 512 512 $1 --out $ICONSET/icon_256x256@2x.png
sips -z 512 512 $1 --out $ICONSET/icon_512x512.png
cp $1 $ICONSET/icon_512x512@2x.png
iconutil -c icns $ICONSET
rm -R $ICONSET
如何使用
然后在终端中,“cd”到同一个文件夹并输入:
source CreateICNS.src {PNG filename}
其中{PNG filename}是您的PNG文件的名称,即xpto.png。
如果你的文件名为abc.png,你可以使用:
source CreateICNS.src abc.png
答案 11 :(得分:3)
Apple的旧版Icon Composer 2.2版工作正常,您只需打开.ICNS,按1024x1024按钮添加图片。
答案 12 :(得分:2)
@ dardo82的shell代码很好&amp;工作。 这是一个更简单的sh(适用于所有* nix)和更快(就像它真的很重要):
#!/bin/sh
# This runs silent, be as verbose as you wish
NAME=$(basename ${1} .png)
DIR="${NAME}.iconset"
mkdir -p ${DIR}
for i in 16 32 128 256 512 ; do
x=""
for p in $i $(($i+$i)) ; do
sips -z $p $p ${1} --out "${NAME}.iconset/icon_${i}x${i}${x}.png"
x="@2x"
done
done >/dev/null # /dev/null in lieu of a "-s" silent option
iconutil -—convert icns $DIR
rm -r $DIR
答案 13 :(得分:2)
答案 14 :(得分:0)
您好,根据我的需要,我制作了一个单独使用拖放图标的小滴或在文件夹中搜索的图标(我限制在文件夹中,因为搜索所有图标的卷可能需要很长时间)。因此,在拖放中,您可以删除文件夹或应用程序,任何可以包含图标的内容。创建的iconset带有原始图标的名称,它放在目录“/ aaaicones”和图标的路径中。文件夹中的示例“/ aaaicones如果您提交xcode.app,您会发现 “/aaaicones/Applications/xcode.app/access.iconset”和/aaaicones/Applications/xcode.app/access.icns(重新创建的图标)将有一个文本文件,在其中跟踪图标的完整路径,并且相应iconset示例的路径 “/Applications/xcode.app/Contents/Applications/Instruments.app/Contents/Frameworks/InstrumentsPlugIn.framework/Versions/A/Resources/access.icns” 在示例中采用“/aaaicones/Applications/xcode.app/access.iconset”(xcode),这可以创建一个214 MB大小的文件夹(包含所有图标和图标集)。如果您单独处理一个图标,它将被放置在“/ aaaicones / aIconeseule /”目录及其原始路径中,例如 / aaaicones / aIconeseule / Mac Elcapitan / .VolumeIcon.icns和/ aaaicones / aIconeseule / Mac Elcapitan /.VolumeIcon.iconset with / aaaicones / aIconeseule / Mac Elcapitan / aalisticones.txt 液滴低于
on open draggedItems
set input to draggedItems
set fich to draggedItems
set media to {}
set theInfo to {}
set n to "0"
repeat with currentItem in draggedItems
set dirchoisi to POSIX path of fich
if ".icns" is not in dirchoisi then
if "Volumes" is not in dirchoisi then
set origi to do shell script "echo /aaaicones" & dirchoisi
set fich to do shell script "echo " & fich & " | xxd -p -c 100000 | sed 's#3a#2f#g' | xxd -r -p | sed 's#" & dirchoisi & "#" & "/aaaicones" & dirchoisi & "#g' | xxd -p -c 100000 | sed 's#2f#3a#g' | xxd -r -p"
tell application "Finder"
if exists (folder fich) then
set nn to "0"
repeat with nn from 1 to 5
set origi to do shell script "echo " & origi & "/" & " | sed 's#//#" & nn & "/" & "#'"
set fich to do shell script "echo " & fich & " | sed 's#:aaaicones*.*#" & origi & "#'" & " | xxd -p -c 100000 | sed 's#2f#3a#g' | xxd -r -p"
if not (exists folder (fich as Unicode text)) then
try
set origi to do shell script "echo " & origi
exit repeat
end try
end if
end repeat
end if
end tell
tell application "Finder"
if not (exists folder (fich as Unicode text)) then
do shell script "mkdir -p -m 0777 " & quoted form of origi
end if
end tell
try
set theInfo to do shell script "find " & (quoted form of dirchoisi) & " -name *.icns "
end try
set AppleScript's text item delimiters to return
set theList to text items of theInfo
set AppleScript's text item delimiters to ""
set n to count theList
repeat with i from 1 to n
if "Volumes" is not in item i of theList then
set end of media to item i of theList
end if
end repeat
set n to count media
set cheminicns to do shell script " > " & quoted form of (origi & "aalisticones.txt") & " | chmod 777 " & quoted form of (origi & "aalisticones.txt")
set cheminicns to do shell script "ls " & quoted form of (origi & "aalisticones.txt")
tell application "Finder"
set letext to (POSIX file cheminicns as alias)
set label index of letext to 2
end tell
repeat with i from 1 to n
set hdd to item i of media
try
set input to do shell script "echo " & hdd & " | sed 's#//#/#g; s#(#\\(#g;s#)#\\)#g' "
do shell script "echo " & quoted form of input & " >>" & quoted form of cheminicns
set png to do shell script "echo " & quoted form of input & " | sed 's#.*/##' "
do shell script "cp -f " & quoted form of input & " " & quoted form of origi
set input to do shell script "iconutil -c iconset " & quoted form of (origi & png)
do shell script "echo " & quoted form of (origi & png) & " | sed 's#.icns#.iconset#' >>" & quoted form of cheminicns
end try
end repeat
tell application "Finder"
if exists (folder fich) then
open fich
end if
end tell
end if
else
set input to do shell script "echo " & dirchoisi & " | sed 's#//#/#g; s#(#\\(#g;s#)#\\)#g' "
set png to do shell script "echo " & quoted form of input & " | sed 's#.*/##' "
set origi to do shell script "echo " & quoted form of ("/aaaicones/aIconeseule/" & input) & " | sed 's#/Volumes/##; s#" & quoted form of png & "##'"
do shell script "mkdir -p -m 0777 " & quoted form of origi
do shell script "echo " & quoted form of input & " >>" & quoted form of origi & "aalisticones.txt"
do shell script "cp -f " & quoted form of input & " " & quoted form of origi
set input to do shell script "iconutil -c iconset " & quoted form of (origi & png)
do shell script "echo " & quoted form of (origi & png) & " >>" & quoted form of origi & "aalisticones.txt"
end if
end repeat
end open
答案 15 :(得分:0)
这是一个主要基于Henry's example的功能(可能在~/.bash_profile
中有用):
mkicns() {
if [[ -z "$*" ]] || [[ "${*##*.}" != "png" ]]; then
echo "Input file invalid"
else
filename="${1%.*}"
mkdir "$filename".iconset
for i in 16 32 128 256 ; do
n=$(( i * 2 ))
sips -z $i $i "$1" --out "$filename".iconset/icon_${i}x${i}.png
sips -z $n $n "$1" --out "$filename".iconset/icon_${i}x${i}@2x.png
[[ $n -eq 512 ]] && \
sips -z $n $n "$1" --out "$filename".iconset/icon_${n}x${n}.png
(( i++ ))
done
cp "$1" "$filename".iconset/icon_512x512@2x.png
iconutil -c icns "$filename".iconset
rm -r "$filename".iconset
fi
}
<强>用法强>:
$ mkicns "filename.png" # double-quote if spaces exist in filename
从
16x16
到512x512@2x
创建10个尺寸;接受输入图像 仅.png
格式。
答案 16 :(得分:0)
我需要这个,但是对于CMake。我还希望选择为其提供SVG。
要点是:https://gist.github.com/Qix-/f4090181e55ea365633da8c3d0ab5249
以及CMake代码:
# LICENSE: CC0 - go nuts.
# Hi :) This is what I used to generate the ICNS for my game, Tide.
# Both input formats (SVG vs PNG) work just fine, but in my experience
# the SVG came out with noticeably better results (although PNG wasn't
# a catastrophe either). The logo for the game was simple enough that
# SVG was indeed an option.
# To use:
#
# make_icns( INPUT "path/to/img.{svg,png}"
# OUTPUT ICNS_PATH )
#
# Then add it as a custom target or use it as a
# dependency somewhere - I give you that option.
#
# For example:
#
# add_custom_target( my-icns ALL DEPENDS "${ICNS_PATH}" )
#
# For the associated utilities:
#
# - PNG: brew install imagemagick
# - SVG: brew cask install inkscape
#
# Enjoy!
function (make_icns_from_png)
cmake_parse_arguments (
ARG
"" # Boolean args
"INPUT;OUTPUT" # List of single-value args
"" # Multi-valued args
${ARGN})
find_program (
convert_exe
NAMES "convert" "convert.exe"
DOC "Path to ImageMagick convert")
if (NOT convert_exe)
message (FATAL_ERROR "Could not find ImageMagick's 'convert' - is ImageMagick installed?")
endif ()
get_filename_component (ARG_INPUT_ABS "${ARG_INPUT}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
get_filename_component (ARG_INPUT_ABS_BIN "${ARG_INPUT}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
get_filename_component (ARG_INPUT_FN "${ARG_INPUT_ABS_BIN}" NAME_WE)
get_filename_component (ARG_INPUT_DIR "${ARG_INPUT_ABS_BIN}" DIRECTORY)
set (sourceimg "${ARG_INPUT_ABS}")
set (basepath "${ARG_INPUT_DIR}/${ARG_INPUT_FN}")
set (output_icns "${basepath}.icns")
set (iconset "${basepath}.iconset")
set (deplist "")
foreach (size IN ITEMS 16 32 128 256 512)
math (EXPR size2x "2 * ${size}")
set (ipath "${iconset}/icon_${size}x${size}.png")
set (ipath2x "${iconset}/icon_${size}x${size}@2x.png")
list (APPEND deplist "${ipath}" "${ipath2x}")
add_custom_command (
OUTPUT "${ipath}"
COMMAND "${convert_exe}" ARGS "${sourceimg}" -resize "${size}x${size}" "${ipath}"
MAIN_DEPENDENCY "${sourceimg}"
COMMENT "ICNS resize: ${ipath}"
VERBATIM)
add_custom_command (
OUTPUT "${ipath2x}"
COMMAND "${convert_exe}" ARGS "${sourceimg}" -resize "${size2x}x${size2x}" "${ipath2x}"
MAIN_DEPENDENCY "${sourceimg}"
COMMENT "ICNS resize: ${ipath2x}"
VERBATIM)
endforeach ()
add_custom_command (
OUTPUT "${output_icns}"
COMMAND iconutil ARGS --convert icns --output "${output_icns}" "${iconset}"
MAIN_DEPENDENCY "${sourceimg}"
DEPENDS ${deplist}
COMMENT "ICNS: ${output_icns}"
VERBATIM)
if (ARG_OUTPUT)
set ("${ARG_OUTPUT}" "${output_icns}" PARENT_SCOPE)
endif ()
endfunction ()
function (make_icns_from_svg)
cmake_parse_arguments (
ARG
"" # Boolean args
"INPUT;OUTPUT" # List of single-value args
"" # Multi-valued args
${ARGN})
set (CMAKE_FIND_APPBUNDLE NEVER) # otherwise, it'll pick up the app bundle and open a shit ton of windows
find_program (
inkscape_exe
NAMES "inkscape" "inkscape.exe"
DOC "Path to Inkscape"
PATHS "/usr/local/bin" "/usr/bin")
message (STATUS "Inkscape path: ${inkscape_exe}")
if (NOT inkscape_exe)
message (FATAL_ERROR "Could not find Inkscape - is it installed?")
endif ()
get_filename_component (ARG_INPUT_ABS "${ARG_INPUT}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
get_filename_component (ARG_INPUT_ABS_BIN "${ARG_INPUT}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
get_filename_component (ARG_INPUT_FN "${ARG_INPUT_ABS_BIN}" NAME_WE)
get_filename_component (ARG_INPUT_DIR "${ARG_INPUT_ABS_BIN}" DIRECTORY)
set (sourceimg "${ARG_INPUT_ABS}")
set (basepath "${ARG_INPUT_DIR}/${ARG_INPUT_FN}")
set (output_icns "${basepath}.icns")
set (iconset "${basepath}.iconset")
set (deplist "")
foreach (size IN ITEMS 16 32 128 256 512)
math (EXPR size2x "2 * ${size}")
set (ipath "${iconset}/icon_${size}x${size}.png")
set (ipath2x "${iconset}/icon_${size}x${size}@2x.png")
list (APPEND deplist "${ipath}" "${ipath2x}")
add_custom_command (
OUTPUT "${ipath}"
COMMAND "${inkscape_exe}" ARGS -z -e "${ipath}" -w ${size} -h ${size} "${sourceimg}"
MAIN_DEPENDENCY "${sourceimg}"
COMMENT "ICNS resize: ${ipath}"
VERBATIM)
add_custom_command (
OUTPUT "${ipath2x}"
COMMAND "${inkscape_exe}" ARGS -z -e "${ipath2x}" -w ${size2x} -h ${size2x} "${sourceimg}"
MAIN_DEPENDENCY "${sourceimg}"
COMMENT "ICNS resize: ${ipath2x}"
VERBATIM)
endforeach ()
add_custom_command (
OUTPUT "${output_icns}"
COMMAND iconutil ARGS --convert icns --output "${output_icns}" "${iconset}"
MAIN_DEPENDENCY "${sourceimg}"
DEPENDS ${deplist}
COMMENT "ICNS: ${output_icns}"
VERBATIM)
if (ARG_OUTPUT)
set ("${ARG_OUTPUT}" "${output_icns}" PARENT_SCOPE)
endif ()
endfunction ()
function (make_icns)
cmake_parse_arguments (
ARG
"" # Boolean args
"INPUT;OUTPUT" # List of single-value args
"" # Multi-valued args
${ARGN})
if (NOT ARG_INPUT)
message (FATAL_ERROR "INPUT is required")
endif ()
if (NOT IS_ABSOLUTE "${ARG_INPUT}")
get_filename_component (ARG_INPUT "${ARG_INPUT}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
endif ()
if (NOT EXISTS "${ARG_INPUT}")
message (FATAL_ERROR "INPUT does not exist: ${ARG_INPUT}")
endif ()
file (RELATIVE_PATH ARG_INPUT "${CMAKE_CURRENT_SOURCE_DIR}" "${ARG_INPUT}")
get_filename_component (ARG_INPUT_EXT "${ARG_INPUT}" EXT)
if ("${ARG_INPUT_EXT}" STREQUAL ".png")
make_icns_from_png (INPUT "${ARG_INPUT}" OUTPUT child_output)
elseif ("${ARG_INPUT_EXT}" STREQUAL ".svg")
make_icns_from_svg (INPUT "${ARG_INPUT}" OUTPUT child_output)
else ()
message (FATAL_ERROR "INPUT must refer to a .png or .svg, but a ${ARG_INPUT_EXT} was provided")
endif ()
if (ARG_OUTPUT)
set ("${ARG_OUTPUT}" "${child_output}" PARENT_SCOPE)
endif ()
endfunction ()