From d05bcfedfd3547838ac60204fbd47e442dc88b2c Mon Sep 17 00:00:00 2001 From: st33v Date: Tue, 23 Feb 2016 20:16:09 +1100 Subject: smaller pix bevcecause not enough ram to analyse pix. --- takepix.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'takepix.sh') diff --git a/takepix.sh b/takepix.sh index 63f3082..444a33c 100755 --- a/takepix.sh +++ b/takepix.sh @@ -1,6 +1,21 @@ #!/bin/bash - +picdir="/home/st33v/pix" picdate=$(date +%Y-%m-%d_%H%M) -/opt/vc/bin/raspistill -x IFD1.Artist=neatherd -o /home/st33v/pix/${picdate}.jpg +thispic=$picdir/$picdate.jpg + +echo thispic = $thispic + +/opt/vc/bin/raspistill -x IFD1.Artist=neatherd -w 1200 -o $thispic + +# now check to see if the pic is too dark (i.e. taken at night) +mean=$(identify -format %[mean] $thispic | sed s/[.].*//) + +echo mean is "$mean" +# too dark +if [ $mean -lt 2000 ]; then + rm $pixdir/$thispic + echo mean of $mean is too low. + exit 13 +fi -- cgit v1.3