Add support for rotation
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
651684ef56
commit
355470d910
1 changed files with 4 additions and 1 deletions
|
@ -11,9 +11,10 @@ DPI=150
|
||||||
|
|
||||||
h=${A4H}
|
h=${A4H}
|
||||||
w=${A4W}
|
w=${A4W}
|
||||||
|
rotate=0
|
||||||
scalearg=""
|
scalearg=""
|
||||||
|
|
||||||
while getopts "d:fhl" opt; do
|
while getopts "d:fhlr:" opt; do
|
||||||
case "${opt}" in
|
case "${opt}" in
|
||||||
d) DPI=${OPTARG} ;;
|
d) DPI=${OPTARG} ;;
|
||||||
f) scalearg="^" ;;
|
f) scalearg="^" ;;
|
||||||
|
@ -22,6 +23,7 @@ while getopts "d:fhl" opt; do
|
||||||
h=${A4W}
|
h=${A4W}
|
||||||
w=${A4H}
|
w=${A4H}
|
||||||
;;
|
;;
|
||||||
|
r) rotate=${OPTARG} ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -33,6 +35,7 @@ shift
|
||||||
|
|
||||||
exec convert "$@" \
|
exec convert "$@" \
|
||||||
-compress jpeg \
|
-compress jpeg \
|
||||||
|
-rotate ${rotate} \
|
||||||
-resize $((w * DPI))x$((h * DPI))${scalearg} \
|
-resize $((w * DPI))x$((h * DPI))${scalearg} \
|
||||||
-gravity center \
|
-gravity center \
|
||||||
-extent $((w * DPI))x$((h * DPI)) \
|
-extent $((w * DPI))x$((h * DPI)) \
|
||||||
|
|
Loading…
Reference in a new issue