# HG changeset patch # User Goffi # Date 1276852454 -28800 # Node ID 50f1591c8fc64c90b71164f671215526e48b696e # Parent 63c9067a1499462ad02f8c4eb4a0abd218a460b0 split_card script: added syntaxe checking diff -r 63c9067a1499 -r 50f1591c8fc6 frontends/wix/images/split_card.sh --- a/frontends/wix/images/split_card.sh Fri Jun 18 15:19:32 2010 +0800 +++ b/frontends/wix/images/split_card.sh Fri Jun 18 17:14:14 2010 +0800 @@ -49,6 +49,22 @@ exit 1 fi +SYNTAXE="Split card image\nsyntaxe: $0 jpeg_image_to_split.jpg" + +if [ $# -ne 1 ] +then + echo $SYNTAXE + exit 1 +fi + +echo `file -b --mime-type $1` | grep image 2>&1 > /dev/null + +if [ $? -ne 0 ] +then + echo "target file is not an image" + exit 1 +fi + current=`pwd` #TODO: check directory presence #echo "making directory"