2 # Create a Flash slideshow
6 KIM_DIR
='/usr/share/GKIM/slideshow'
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'`;
22 if SCALE
=`zenity --entry --title="Titre" --text="Veuillez saisir la résolution des images" --entry-text="600x450"`
24 echo "SCALE = $SCALE";
29 if DIR
=`zenity --title "Selecionner le repertoire où stocker le slideshow" --file-selection --directory`
36 W
=`echo $SCALE | sed 's/[^0-9]/ /g' | awk '{print $1}'`;
37 H
=`echo $SCALE | sed 's/[^0-9]/ /g' | awk '{print $2}'`;
39 DIR
=`echo $DIR | sed 's/" "/"\ "/g'`;
42 mkdir
"$DIR"/images
/tmp
;
43 cp $KIM_DIR/dewslider.swf
"$DIR";
44 # Header of "$DIR"/index.html
45 cp $KIM_DIR/index.part1
"$DIR"/index.html
;
46 echo '<h1>'$TITLE'</h1>' >> "$DIR"/index.html
;
47 echo '<h5>Auteur: '$AUTHOR'</h5>' >> "$DIR"/index.html
;
48 echo '<h5>Date: '$DATE'</h5>' >> "$DIR"/index.html
;
51 echo '<object type="application/x-shockwave-flash" data="dewslider.swf?xml=dewslider.xml" width="'$W2'" height="'$H2'">' >> "$DIR"/index.html
;
52 cat $KIM_DIR/index.part2
>> "$DIR"/index.html
;
53 # Header of "$DIR"/dewslider.xml
54 echo '<?xml version="1.0" ?>' > "$DIR"/dewslider.xml
;
55 echo '<album' >> "$DIR"/dewslider.xml
;
56 echo 'width="'$W'" height="'$H'"' >> "$DIR"/dewslider.xml
;
57 echo 'bgcolor="0xeeeeee" framecolor="0xffffff" padding="10" margin="10"' >> "$DIR"/dewslider.xml
;
58 echo 'shadow="8" shadowopacity="15%" shadowcolor="0x000000" showbuttons="on"' >> "$DIR"/dewslider.xml
;
59 echo 'buttonstyle="flat" showtxt="on" txtcolor="0xcccccc" auto="5" fullscreen="off"' >> "$DIR"/dewslider.xml
;
60 echo '>' >> "$DIR"/dewslider.xml
;
67 #convert -resize $SCALE "$FILE" "$DIR"/images/`basename "$FILE"`.jpg;
68 width
=`identify -format "%w" "$FILE"`;
69 height
=`identify -format "%h" "$FILE"`;
70 if [ "$width" -gt "$height" ]; then
71 convert
-resize $SCALE "$FILE" "$DIR"/images
/`basename "$FILE"`.jpg
;
73 convert
-gravity Center
-crop "80x80%%+0+0" -resize ${W}"x" +repage -crop ${W}"x"${H}"+0+0" -resize "x"${H} +repage -crop ${W}"x"${H}"+0+0" -blur 0x40 +repage
"$FILE" "$DIR"/images
/tmp
/`basename "$FILE"`_1.jpg
;
74 convert
-resize ${W}"x"${H} "$FILE" "$DIR"/images
/tmp
/`basename "$FILE"`_2.jpg
;
75 convert
"$DIR"/images
/tmp
/`basename "$FILE"`_1.jpg
"$DIR"/images
/tmp
/`basename "$FILE"`_2.jpg
-gravity Center
-composite "$DIR"/images
/`basename "$FILE"`.jpg
77 echo '<img src="images/'`basename "$FILE"`'.jpg" title="'`basename "$FILE"`'" />' >> "$DIR"/dewslider.xml
;
81 )| zenity
--progress \
82 --title="Création du slideshow" \
86 rm -r "$DIR"/images
/tmp
;
87 echo '</album>' >> "$DIR"/dewslider.xml
;
89 firefox
"$DIR"/index.html
;