diff options
author | Patrick Simianer <p@simianer.de> | 2014-10-09 20:44:15 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-10-09 20:44:15 +0100 |
commit | ca41eddfdc979955105cce572e659941544d6f6d (patch) | |
tree | bf446902e8323e58c6fc14dce808b9719da7d3f6 /jpegtran_rotate_lossless | |
parent | 0aae427eb3838297f6e204c2961739ef834762cf (diff) |
alles neu macht der mai
Diffstat (limited to 'jpegtran_rotate_lossless')
-rwxr-xr-x | jpegtran_rotate_lossless | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/jpegtran_rotate_lossless b/jpegtran_rotate_lossless new file mode 100755 index 0000000..f876e10 --- /dev/null +++ b/jpegtran_rotate_lossless @@ -0,0 +1,35 @@ +#!/bin/sh + +function usage { + echo 'Usage: jpegtran-rotate-lossless.sh <90|180|270> <file>' + exit 1 +} + +ROTATION=$1 +FILE=$2 + +if [ $# -ne 2 ]; then + usage +fi + +case $ROTATION in + 90|180|270) + true ;; + *) + usage ;; +esac + +jpegtran -rotate $ROTATION -trim -copy all $FILE > $FILE-rotate +if [ $? -ne 0 ]; then + echo 'jpegtran-rotate-lossless.sh: jpegtran failed' + exit 1 +fi + +mv $FILE-rotate $FILE +if [ $? -ne 0 ]; then + 'jpegtran-rotate-lossless.sh: mv failed' + exit 1 +fi + +exit 0 + |