From 5e0a757a1b758819d3874b4aea5d8b7491bcb046 Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 18 Jun 2010 17:14:14 +0800 Subject: [PATCH] split_card script: added syntaxe checking --- frontends/wix/images/split_card.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/frontends/wix/images/split_card.sh b/frontends/wix/images/split_card.sh index 9e34efb9..3d49bb17 100755 --- a/frontends/wix/images/split_card.sh +++ b/frontends/wix/images/split_card.sh @@ -49,6 +49,22 @@ then 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"