Skip to content

Instantly share code, notes, and snippets.

@ctroncoso
Last active August 29, 2015 14:16
Show Gist options
  • Save ctroncoso/7303f03f28211df5be4f to your computer and use it in GitHub Desktop.
Save ctroncoso/7303f03f28211df5be4f to your computer and use it in GitHub Desktop.
Script para captura de imágenes volcán Villarrica
#!/bin/bash
while true
do
TSF=$(date +\%Y-\%m-\%d_\%H-\%M-\%S)
TSG=$(date +\%Y-\%m-\%d_\%H:\%M:\%S)
echo
echo "Running $TSG"
echo "downloading"
wget --output-document=pucon_$TSF.jpg http://www.sernageomin.cl/camaras/Pucon/fija/pucon.jpg &> /dev/null
wget --output-document=vnv_$TSF.jpg http://www.sernageomin.cl/camaras/Vnv/fija/vnv.jpg &> /dev/null
wget --output-document=llafenco_$TSF.jpg http://www.sernageomin.cl/camaras/Llafen2/fija/llafenco.jpg &> /dev/null
echo "resizing"
convert vnv_$TSF.jpg -resize '320x240' miff:vnv_$TSF.miff
convert llafenco_$TSF.jpg -resize '320x240' miff:llafenco_$TSF.miff
convert pucon_$TSF.jpg -resize '640x480' miff:pucon_$TSF.miff
#
convert -size '320x240' canvas:black vnv_$TSF.miff -flatten miff:vnv_$TSF.miff
convert -size '320x240' canvas:black llafenco_$TSF.miff -flatten miff:llafenco_$TSF.miff
convert -size '640x480' canvas:black pucon_$TSF.miff -flatten miff:pucon_$TSF.miff
echo "captioning"
convert vnv_$TSF.miff -fill white -undercolor '#00000080' -gravity northwest -pointsize 18 -annotate +5+5 'Volcan' miff:vnv_$TSF.miff
convert llafenco_$TSF.miff -fill white -undercolor '#00000080' -gravity northwest -pointsize 18 -annotate +5+5 'Llafenco' miff:llafenco_$TSF.miff
convert pucon_$TSF.miff -fill white -undercolor '#00000080' -gravity northwest -pointsize 18 -annotate +5+5 'Pucón' miff:pucon_$TSF.miff
echo "compositing"
convert -background Orange \
'(' \
'(' llafenco_$TSF.miff vnv_$TSF.miff -append ')' \
pucon_$TSF.miff +append \
')' -pointsize 48 label:"$TSG" -gravity Center -append villarrica_$TSF.jpg
rm vnv_$TSF.jpg llafenco_$TSF.jpg pucon_$TSF.jpg
rm vnv_$TSF.miff llafenco_$TSF.miff pucon_$TSF.miff
echo "waiting 2 minutes"
sleep 120
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment