Add support for rotation

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2024-02-01 00:35:48 +01:00
parent 651684ef56
commit 355470d910
Signed by: luzifer
SSH key fingerprint: SHA256:/xtE5lCgiRDQr8SLxHMS92ZBlACmATUmF1crK16Ks4E

View file

@ -11,9 +11,10 @@ DPI=150
h=${A4H}
w=${A4W}
rotate=0
scalearg=""
while getopts "d:fhl" opt; do
while getopts "d:fhlr:" opt; do
case "${opt}" in
d) DPI=${OPTARG} ;;
f) scalearg="^" ;;
@ -22,6 +23,7 @@ while getopts "d:fhl" opt; do
h=${A4W}
w=${A4H}
;;
r) rotate=${OPTARG} ;;
esac
done
@ -33,6 +35,7 @@ shift
exec convert "$@" \
-compress jpeg \
-rotate ${rotate} \
-resize $((w * DPI))x$((h * DPI))${scalearg} \
-gravity center \
-extent $((w * DPI))x$((h * DPI)) \