create changelog entry
[debian/openrocket] / core / resources-src / datafiles / tours / convert-images.sh
1 #!/bin/bash
2
3 #
4 # A script to batch-convert all source image files into suitable
5 # slideset image files.  It converts all *.png, *.jpg and *.xcf.gz
6 # files into the suitably sized jpg images in the datafiles directory.
7 #
8
9 DEST=../../../resources/datafiles/tours
10
11 CONVERSION="-background #ececec -flatten -geometry 600x400 -quality 85"
12
13
14 # Convert all xcf files
15 find -iname "*.xcf.gz" | grep -v MANUAL | while read FILE; do
16
17     echo Converting $FILE
18     BASE="$(echo $FILE | sed 's/\.xcf\.gz$//')"
19     xcf2png "$FILE" | convert $CONVERSION - $DEST/$BASE.jpg
20
21 done
22
23 # Convert all png and jpg files
24 find -iname "*.png" -o -iname "*.jpg" | grep -v MANUAL | while read FILE; do 
25
26     echo Converting $FILE
27     BASE="$(echo $FILE | sed 's/\.png$//' | sed 's/\.jpg$//')"
28     convert $CONVERSION $FILE $DEST/$BASE.jpg
29
30 done