#!/bin/sh
#set -x
mkdir rotate.bck
echo Insert index number of pictures to rotate:
read num
echo Rotate angle -90 counter clockwise and +90 other way 
read rotation

for  filen in `echo $num`  ; do
################################################

file=`head -$filen albumlist.txt | tail -1`
fileout=`echo ${file} | cut -f1 -d"|"`
#rotation=`echo ${file} | cut -f3 -d"|"`


echo convert -rotate $rotation ${fileout}_big.jpg ${fileout}_big.jpg
cp ${fileout}_big.jpg rotate.bck
convert -rotate $rotation ${fileout}_big.jpg ${fileout}_big.jpg
echo convert -rotate $rotation ${fileout}_th.jpg ${fileout}_th.jpg
cp ${fileout}_th.jpg rotate.bck
convert -rotate $rotation ${fileout}_th.jpg ${fileout}_th.jpg

done


