#!/bin/bash

SRC="$HOME/public_html/diletto/minime"
XML="dewslider.xml"

cat > $XML <<EOF
<?xml version="1.0" ?>
<!-- this file is automatically generated by createImages.sh do NOT edit -->
  <album 
    showbuttons="no"
    showtitles="yes"
    randomstart="no"
    timer="3"
    aligntitles="bottom"
    alignbuttons="bottom"
    transition="fade"
    speed="20"
  >

EOF

#0.37 0 0   0 0.75 0  0 0 1
convert -size 640x480 xc:none -fill '#60C0Ff' -draw "circle 320,240 800,800" bg.png

for file in $SRC/*-small.png ; do
  out=${file##*/}
  echo "<img src='slides/surfaces/$out' />" >> $XML
#  echo "<li><img src='$out'></img></li>" >> $HTML
  echo "$file -> $out"
#  fig2dev -L png -m 0.3 -S 4 "$SRC"/cubeFolding$n.fig tmp.png
#  convert tmp.png -negate tmp2.png
  cp $file tmp.png
  composite -compose Dst_Over bg.png tmp.png tmp2.png
  convert tmp2.png -resize '199x152!' -background blue $out
done

echo "</album>" >> $XML
rm bg.png tmp.png tmp2.png

 