Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
A shell script to create AppStore screen shots.
#!/bin/sh
# settings ==========
# src file name
fileNamePrefix="ScreenShotFileNameFor5.5inch"
offsetFor3_5=20
# dest directory name
destDir="./dest/"
destDir4_7="4.7inch/"
destDir4="4inch/"
destDir3_5="3.5inch/"
# ====================
# create dest directory
mkdir $destDir
mkdir $destDir$destDir4_7
mkdir $destDir$destDir4
mkdir $destDir$destDir3_5
# loop for 4.7inch
echo "4.7inch"
for i in 1 2 3 4 5
do
destFilePath=$destDir$destDir4_7$fileNamePrefix$i".png"
echo $destFilePath
convert -resize x1334 $fileNamePrefix$i".png" $destFilePath
done
# loop for 4inch
echo "4inch"
for i in 1 2 3 4 5
do
destFilePath=$destDir$destDir4$fileNamePrefix$i".png"
echo $destFilePath
convert -resize 640x $fileNamePrefix$i".png" $destFilePath
convert -crop 640x1136+0+0 $destFilePath $destFilePath
done
# loop for 3.5inch
echo "3.5inch"
for i in 1 2 3 4 5
do
destFilePath=$destDir$destDir3_5$fileNamePrefix$i".png"
echo $destFilePath
convert -resize 640x $fileNamePrefix$i".png" $destFilePath
convert -crop 640x960+0+$offsetFor3_5 $destFilePath $destFilePath
done
@jsuo

This comment has been minimized.

Show comment Hide comment
@jsuo

jsuo Nov 21, 2015

Many thanks.

jsuo commented Nov 21, 2015

Many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment