Last active
June 21, 2020 19:57
-
-
Save haranicle/55debc2e46ef643341cc to your computer and use it in GitHub Desktop.
A shell script to create AppStore screen shots.
This file contains hidden or 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 | |
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Many thanks.