-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#/bin/bash | ||
# This script generates an icns file (for iOS and macOS) from a png file. | ||
# Requires macOS (sips and iconutil) | ||
|
||
if [ -z "$1" || -z $2 ]; then | ||
echo "Usage: $0 <icon_name> <output_dir>" | ||
exit 1 | ||
fi | ||
|
||
if ! [ -f "$1.png" ]; then | ||
echo "Error: $1.png does not exist" | ||
exit 2 | ||
fi | ||
|
||
mkdir -p $1.iconset | ||
mkdir -p $2 | ||
|
||
sips -z 16 16 $1.png --out $1.iconset/icon_16x16.png | ||
sips -z 32 32 $1.png --out $1.iconset/icon_16x16@2x.png | ||
sips -z 32 32 $1.png --out $1.iconset/icon_32x32.png | ||
sips -z 64 64 $1.png --out $1.iconset/icon_32x32@2x.png | ||
sips -z 128 128 $1.png --out $1.iconset/icon_128x128.png | ||
sips -z 256 256 $1.png --out $1.iconset/icon_128x128@2x.png | ||
sips -z 256 256 $1.png --out $1.iconset/icon_256x256.png | ||
sips -z 512 512 $1.png --out $1.iconset/icon_256x256@2x.png | ||
sips -z 512 512 $1.png --out $1.iconset/icon_512x512.png | ||
sips -z 1024 1024 $1.png --out $1.iconset/icon_512x512@2x.png | ||
|
||
iconutil -c icns --output $2/$1.icns $1.iconset | ||
rm -R $1.iconset |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.