~ubuntu-branches/ubuntu/intrepid/enigma/intrepid

« back to all changes in this revision

Viewing changes to data/levels/00makepreviews.sh

  • Committer: Bazaar Package Importer
  • Author(s): Erich Schubert
  • Date: 2005-08-28 15:30:09 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050828153009-sky64kb6tcq37xt5
Tags: 0.92.1-1
* New upstream subversion checkout
* Remove menu.s3m, which we are allowed to distributed but not to modify
  also copyright notice is confusing... (Closes: #321669)
* Rebuild with new libzipios (Closes: #325405)
  I hope this works without a versioned build-dependency
* Added "enigma replaces enigma-data" for upgrades (Closes: #308558)
* Added notes about the fonts copyright.
* updated to policy 3.6.2.1 (no changes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
 
3
 
SCREENSHOTS=../../screenshots
4
 
 
5
 
update_if_newer()  {
6
 
    if [ -f $1 ]; then
7
 
        if [ $1 -nt $2 ]; then
8
 
            echo "creating $2"
9
 
            convert $1 -crop 640x416+0+0 -resize 120x78 $2
10
 
        fi
11
 
    fi
12
 
}
13
 
 
14
 
update_for_subdir() {
15
 
    if [ -d $1 ]; then
16
 
        if [ -d $SCREENSHOTS/$1 ]; then
17
 
            for shot in $SCREENSHOTS/$1/*.png; do
18
 
                base=`basename $shot .png`
19
 
                png="$1/$base.png"
20
 
                update_if_newer $shot $png
21
 
            done
22
 
        fi
23
 
    else
24
 
        echo "Error: no such directory '$1'"
25
 
        exit 1
26
 
    fi
27
 
}
28
 
 
29
 
if [ -d $SCREENSHOTS ]; then
30
 
    for shot in $SCREENSHOTS/*.png; do
31
 
        base=`basename $shot .png`
32
 
        png="$base.png"
33
 
        update_if_newer $shot $png
34
 
    done
35
 
 
36
 
    update_for_subdir Sokoban
37
 
    update_for_subdir m_tutor
38
 
else
39
 
    echo "Error: no such directory ($SCREENSHOTS)"
40
 
    exit 1
41
 
fi
42
 
 
43
 
NEWPREVIEWS=`find . -name "*.png" -cmin -5`
44
 
COUNT=`echo $NEWPREVIEWS | wc -w`
45
 
 
46
 
if [ $COUNT = 0 ]; then
47
 
    echo "All existing previews were up-to-date."
48
 
else
49
 
    # if pngcrush is installed crush previews
50
 
    if [ -x /usr/local/bin/pngcrush ] ; then
51
 
        ./04crushprevievs.sh $NEWPREVIEWS
52
 
    elif which optipng ; then
53
 
        optipng $NEWPREVIEWS
54
 
    fi
55
 
 
56
 
    echo "$COUNT preview(s) updated."
57
 
fi