From 355470d91047d997148335df96c0dfeb53a32960 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 1 Feb 2024 00:35:48 +0100 Subject: [PATCH] Add support for rotation Signed-off-by: Knut Ahlers --- bin/img2pdf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/img2pdf b/bin/img2pdf index 9f897f0..b0b8e5c 100755 --- a/bin/img2pdf +++ b/bin/img2pdf @@ -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)) \