comparison frontends/wix/images/split_card.sh @ 100:50f1591c8fc6

split_card script: added syntaxe checking
author Goffi <goffi@goffi.org>
date Fri, 18 Jun 2010 17:14:14 +0800
parents 7471ffcda33b
children 23023aff91fd
comparison
equal deleted inserted replaced
99:63c9067a1499 100:50f1591c8fc6
44 CONVERT_REV=`echo $CONVERT_VER | cut -d . -f 3` 44 CONVERT_REV=`echo $CONVERT_VER | cut -d . -f 3`
45 45
46 if [ $CONVERT_MAJOR -lt 6 -o $CONVERT_MAJOR -eq 6 -a $CONVERT_MINOR -lt 6 ] 46 if [ $CONVERT_MAJOR -lt 6 -o $CONVERT_MAJOR -eq 6 -a $CONVERT_MINOR -lt 6 ]
47 then 47 then
48 echo "ImageMagick convert must be at least version 6.6.0 (current: $CONVERT_VER)" 48 echo "ImageMagick convert must be at least version 6.6.0 (current: $CONVERT_VER)"
49 exit 1
50 fi
51
52 SYNTAXE="Split card image\nsyntaxe: $0 jpeg_image_to_split.jpg"
53
54 if [ $# -ne 1 ]
55 then
56 echo $SYNTAXE
57 exit 1
58 fi
59
60 echo `file -b --mime-type $1` | grep image 2>&1 > /dev/null
61
62 if [ $? -ne 0 ]
63 then
64 echo "target file is not an image"
49 exit 1 65 exit 1
50 fi 66 fi
51 67
52 current=`pwd` 68 current=`pwd`
53 #TODO: check directory presence 69 #TODO: check directory presence