| 1 |
#! /bin/sh |
| 2 |
|
| 3 |
# This script creates the .png images for the App Store |
| 4 |
# from the screen shots in the "screenshots" directory. |
| 5 |
# |
| 6 |
# The ImageMagick program "convert" must be installed. |
| 7 |
|
| 8 |
# To rotate a screen shot use: |
| 9 |
# convert screenshots/IMG_0020.PNG -rotate 90 screenshots/IMG_0020_new.PNG |
| 10 |
|
| 11 |
rm -rf appstore-screenshots |
| 12 |
mkdir appstore-screenshots |
| 13 |
|
| 14 |
cd screenshots |
| 15 |
|
| 16 |
for f in *.PNG *.png ; do |
| 17 |
|
| 18 |
res=`identify "$f" | cut "-d " -f3` |
| 19 |
|
| 20 |
case "$res" in |
| 21 |
|
| 22 |
320x480) geom="320x460+0+20" |
| 23 |
;; |
| 24 |
|
| 25 |
480x320) geom="480x300+0+20" |
| 26 |
;; |
| 27 |
|
| 28 |
640x960) geom="640x920+0+40" |
| 29 |
;; |
| 30 |
|
| 31 |
640x1136) geom="640x1096+0+40" |
| 32 |
;; |
| 33 |
|
| 34 |
960x640) geom="960x640+0+0" |
| 35 |
;; |
| 36 |
|
| 37 |
768x1024) geom="768x1004+0+20" |
| 38 |
;; |
| 39 |
|
| 40 |
1024x768) geom="1024x748+0+20" |
| 41 |
;; |
| 42 |
|
| 43 |
1136x640) geom="1136x640+0+0" |
| 44 |
;; |
| 45 |
|
| 46 |
1536x2048) geom="1536x2008+0+40" |
| 47 |
;; |
| 48 |
|
| 49 |
*) echo "unsupported resolution $res" |
| 50 |
identify "$f" |
| 51 |
exit 1 |
| 52 |
;; |
| 53 |
|
| 54 |
esac |
| 55 |
|
| 56 |
convert "$f" -crop "$geom" ../appstore-screenshots/"$f" |
| 57 |
|
| 58 |
done |
| 59 |
|
| 60 |
cd .. |