2 # Create a html gallery
5 #kdeinstdir=`kde4-config --prefix`
6 KIM_DIR
=/usr
/share
/GKIM
/gallery
7 if TITLE
=`zenity --entry --title="Titre" --text="Veuillez saisir le titre"`
14 if AUTHOR
=`zenity --entry --title="Titre" --text="Veuillez saisir l'auteur" --entry-text="$USER"`
16 echo "AUTHOR = $AUTHOR";
21 DATE
=`date '+%A %-d %B %Y'`;
24 if K
=`zenity --entry --title="Nombre de colonnes" --text="Veuillez saisir le nombre de colonnes : " --entry-text="4"`
31 if DIR
=`zenity --title "Selecionner le repertoire où stocker la gallery" --file-selection --directory`
42 # Creation of directories
45 # Header of $DIR/index.html
46 cp $KIM_DIR/index.part1_gallery
$DIR/index.html
;
47 echo '<h1>'$TITLE'</h1>' >> $DIR/index.html
;
48 echo '<h5>Auteur: '$AUTHOR'<br>Date: '$DATE'</h5>' >> $DIR/index.html
;
49 echo '<table><tr>' >> $DIR/index.html
;
55 #test if cancel button has been pushed
59 IMAGE
=`basename "$FILE"`;
60 convert
-resize $SCALE_1 "$FILE" $DIR/images
/"$IMAGE";
61 convert
-resize $SCALE_2 "$FILE" $DIR/thumbs
/"$IMAGE";
62 W2
=`identify -format "%w" $DIR/images/"$IMAGE"`;
63 H2
=`identify -format "%h" $DIR/images/"$IMAGE"`;
64 echo '<td align='center
'>' >> $DIR/index.html
;
65 if [ "$H2" -lt "$W2" ];
66 then echo '<a href="images/'"$IMAGE"'"><img class="photo" src="thumbs/'"$IMAGE"'" width="'$W'" height="'$H'" alt="thumbs/'"$IMAGE"'" title="'"$IMAGE"'"></a>' >> $DIR/index.html
;
67 else echo '<a href="images/'"$IMAGE"'"><img class="photo" src="thumbs/'"$IMAGE"'" width="'$H'" height="'$W'" alt="thumbs/'"$IMAGE"'" title="'"$IMAGE"'"></a>' >> $DIR/index.html
;
69 echo '<p>'"$IMAGE"'</p>' >> $DIR/index.html
;
70 echo '</td>' >> $DIR/index.html
;
71 if [ "$tmp" -eq "$K" ];
72 then echo '</tr><tr>' >> $DIR/index.html
;
78 --title="Création de la gallery" \
82 cat $KIM_DIR/index.part2_gallery
>> $DIR/index.html
;
85 firefox
$DIR/index.html
;