Skip to content

Instantly share code, notes, and snippets.

@codetalks-new
Created June 15, 2015 09:06
Show Gist options
  • Select an option

  • Save codetalks-new/a2875da4c51f2eba7d6d to your computer and use it in GitHub Desktop.

Select an option

Save codetalks-new/a2875da4c51f2eba7d6d to your computer and use it in GitHub Desktop.
批量生成 iOS AppIcon 图标脚本
#!/bin/bash
echo mkdir
rmdir -rf appIcons
mkdir appIcons
echo resize icon $1
img=$1
#IFS='.' read -ra fcomps <<< "$img"
#echo fcomps is ${fcomps[@]}
#compsCount=${#fcomps[@]}
#echo comps count $compsCount
#fext=${fcomps[$compsCount - 1]}
#echo icon file extension is $fext
fext='png'
## in ios image format must be png
## and image magic will convert automatically by the ext
convert $img -resize 58x58 appIcons/appIcon_29x29@2x.$fext
convert $img -resize 87x87 appIcons/appIcon_29x29@3x.$fext
convert $img -resize 80x80 appIcons/appIcon_40x40@2x.$fext
convert $img -resize 120x120 appIcons/appIcon_40x40@3x.$fext
convert $img -resize 120x120 appIcons/appIcon_60x60@2x.$fext
convert $img -resize 152x152 appIcons/appIcon_76x76@2x.$fext
echo convert done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment