-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImageResizerShellScript.sh
More file actions
executable file
·59 lines (52 loc) · 2.08 KB
/
Copy pathImageResizerShellScript.sh
File metadata and controls
executable file
·59 lines (52 loc) · 2.08 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Source PNGs from drawable folder
SRC_DARK="composeApp/src/commonMain/composeResources/drawable/app_icon.png"
SRC_LIGHT="composeApp/src/commonMain/composeResources/drawable/app_icon_light.png"
SRC_TINTED="composeApp/src/commonMain/composeResources/drawable/app_icon_tinted.png"
# Destination paths
APPICON_DEST="iosApp/iosApp/Assets.xcassets/AppIcon.appiconset"
LOCK_DEST="iosApp/iosApp/Assets.xcassets/lockscreen.imageset"
FAV_DEST="iosApp/iosApp/Assets.xcassets/favicon.imageset"
# Clean and ensure directories exist
rm -rf "$APPICON_DEST"/*
mkdir -p "$APPICON_DEST"
mkdir -p "$LOCK_DEST"
mkdir -p "$FAV_DEST"
# 1. Copy App Icons (Single 1024x1024 assets)
cp "$SRC_LIGHT" "$APPICON_DEST/icon_light_1024.png"
cp "$SRC_DARK" "$APPICON_DEST/icon_dark_1024.png"
cp "$SRC_TINTED" "$APPICON_DEST/icon_tinted_1024.png"
# 2. Lockscreen Imageset
cp "$SRC_LIGHT" "$LOCK_DEST/lockscreen.png"
# 3. Favicon Resizing (Required sizes for web/pwa)
magick "$SRC_LIGHT" -resize 64x64 "$FAV_DEST/favicon.png"
magick "$SRC_LIGHT" -resize 128x128 "$FAV_DEST/favicon@2x.png"
magick "$SRC_LIGHT" -resize 192x192 "$FAV_DEST/favicon@3x.png"
# --- GENERATE LOCKSCREEN ---
mkdir -p "$LOCK_DEST"
cp "$SRC_LIGHT" "$LOCK_DEST/lockscreen.png"
cat <<EOF > "$LOCK_DEST/Contents.json"
{
"images": [
{"filename": "lockscreen.png", "idiom": "universal", "scale": "1x"},
{"idiom": "universal", "scale": "2x"},
{"idiom": "universal", "scale": "3x"}
],
"info": {"author": "xcode", "version": 1}
}
EOF
# --- GENERATE FAVICON ---
mkdir -p "$FAV_DEST"
magick "$SRC_LIGHT" -resize 64x64 "$FAV_DEST/favicon.png"
magick "$SRC_LIGHT" -resize 128x128 "$FAV_DEST/favicon@2x.png"
magick "$SRC_LIGHT" -resize 192x192 "$FAV_DEST/favicon@3x.png"
cat <<EOF > "$FAV_DEST/Contents.json"
{
"images": [
{"filename": "favicon.png", "idiom": "universal", "scale": "1x"},
{"filename": "favicon@2x.png", "idiom": "universal", "scale": "2x"},
{"filename": "favicon@3x.png", "idiom": "universal", "scale": "3x"}
],
"info": {"author": "xcode", "version": 1}
}
EOF
echo "Master icons copied. Please ensure Xcode is set to 'Single Size' for AppIcon."