Created
August 22, 2019 09:01
-
-
Save tompi/14d0c3a713a03ff70e05fcdbbf8dffb9 to your computer and use it in GitHub Desktop.
Make android splash screens
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
#!/bin/sh | |
# | |
# Thomas Haukland | |
original=`echo $1 | sed 's/.png//'` | |
rm -rf ios droid | |
# iOS | |
#mkdir ios | |
#for size in 20 29 40 58 60 76 80 87 120 152 167 180 512 1024; do | |
# newname="$original-$size.png" | |
# newfile="ios/$newname" | |
# cp $1 $newfile | |
# sips -Z $size $newfile | |
#done; | |
# droid | |
mkdir droid | |
for dpiAndSize in "ldpi-200x320" "mdpi-320x480" "hdpi-480x800" "xhdpi-720x1280" "xxhdpi-960x1600" "xxxhdpi-1280x1920"; do | |
dpifolder=`echo $dpiAndSize | sed "s/-.*//"` | |
dpifolder="drawable-$dpifolder" | |
mkdir "droid/$dpifolder" | |
size=`echo $dpiAndSize | sed "s/.*-//"` | |
height=`echo $size | sed "s/.*x//"` | |
width=`echo $size | sed "s/x.*//"` | |
newfile="droid/$dpifolder/splash.png" | |
cp $1 $newfile | |
# echo "Height: $height Width: $width" | |
sips -z $height $width $newfile | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment