1#!/bin/sh
2# Etienne M. - 10/2008
3#$1	$2		$3	$4	$5	$6	$7
4#url	imagePath	screenx	screeny	timeout	finalx	finaly
5
6read LINE
7set $LINE
8
9#echo "----------------------------------------" >>snap.log
10#date >>snap.log
11
12if [ "$#" != "7" ]; then
13  #echo "Nombre de parametres incorrect" |tee -a snap.log;
14  echo "Nombre de parametres incorrect";
15  exit;
16fi
17
18#Effectue la capture
19#Do the snap
20#./html2image $1 $2 -W$3 -H$4 -t$5 |tee -a snap.log
21./html2image $1 $2 -W$3 -H$4 -t$5
22
23#Redimensionne la capture
24#Resize the snap
25if [ $6 -lt $7 ]; then
26  #echo "Resize x$7" |tee -a snap.log;
27  echo "Resize x$7";
28  #convert -resize x$7 $2 $2 |tee -a snap.log;
29  convert -resize x$7 $2 $2;
30else
31  #echo "Resize $6" |tee -a snap.log;
32  echo "Resize $6";
33  #convert -resize $6 $2 $2 |tee -a snap.log;
34  convert -resize $6 $2 $2;
35fi
36
37#echo "Crop $6x$7+0+0" |tee -a snap.log
38echo "Crop $6x$7+0+0"
39#convert -crop $6x$7+0+0 $2 $2 |tee -a snap.log
40convert -crop $6x$7+0+0 $2 $2
41
42