diff --git a/README b/README index 0bcc95f..27a4d14 100644 --- a/README +++ b/README @@ -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` diff --git a/rotate.sh b/rotate.sh new file mode 100755 index 0000000..75d2392 --- /dev/null +++ b/rotate.sh @@ -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 + + + +