changeset 100:50f1591c8fc6

split_card script: added syntaxe checking
author Goffi <goffi@goffi.org>
date Fri, 18 Jun 2010 17:14:14 +0800
parents 63c9067a1499
children 783e9d6980ec
files frontends/wix/images/split_card.sh
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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"