-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathCreateUniversalAppIcons.sh
30 lines (20 loc) · 1.15 KB
/
CreateUniversalAppIcons.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# Name of original image (place in the same folder as this script)
originalImage="originalimage.png"
# Make sure the path actually exists
if [ -f "$originalImage" ]; then
# Define sizes and names based on https://developer.apple.com/library/content/qa/qa1686/_index.html
appIcons=(['512']='iTunesArtwork.png' ['1024']='[email protected]' ['120']='[email protected]' ['180']='[email protected]' ['76']='Icon-76.png' ['152']='[email protected]' ['40']='Icon-Small-40.png' ['80']='[email protected]' ['120']='[email protected]' ['29']='Icon-Small.png' ['58']='[email protected]' ['87']='[email protected]')
# Loop through each of the desired sizes
for newSize in "${!appIcons[@]}"
do
# New filename
newName="${appIcons[$newSize]}"
# Make a copy first, so we keep the original image
/bin/cp "$originalImage" "$newName"
echo -e "Resizing $newName to $newSize by $newSize\n"
/usr/bin/sips -z "$newSize" "$newSize" "$newName"
done
else
/bin/echo "$originalImage does not exist or isn't properly named. Make sure it is in the same folder as this script"
fi