rotate script

master
Castro0o 7 years ago
parent 73003276e4
commit 41a07ef27a

@ -8,7 +8,12 @@ pdftk, imagemagick
### imgs2pdf.sh
Converts a directory of images onto a single PDF
Usage: ./imgs2pdf.sh imgs-dir-name pdf-filename
Usage: `./imgs2pdf.sh imgs-dir-name pdf-filename`
If no pdf-filename is provided, output.pdf will the default file name
### rotate.sh
Rotates all images in one a directory a given number of degrees
Usage: `./rotate.sh imgs-dir-name rotation-in-degrees`

@ -0,0 +1,31 @@
#!/bin/sh
# Script
# Software dependencies: imagemagick
# Usage: ./rotate.sh imgs-dir-name pdf-filename
DIR=""
DEG=""
#echo ${#1}
if [ ${#1} -gt 0 ] # check arguments given
then
DIR=$1
echo "Images from $DIR directory are being rotated"
if [ ${#2} -gt 0 ]
then
DEG=$2
for IMG in $DIR* # rotate each $IMG in $DIR n $DEGs
do mogrify -rotate $DEG $IMG
done
else
echo "You forgot to provide the roation value (in degrees) as the second argument"
fi
else
echo "You forgot to provide the images directory as the first argument"
fi
Loading…
Cancel
Save