summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/pagelayout/scripts/pagelayoutapi
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/pagelayout/scripts/pagelayoutapi')
-rwxr-xr-xmacros/latex/contrib/pagelayout/scripts/pagelayoutapi19
1 files changed, 18 insertions, 1 deletions
diff --git a/macros/latex/contrib/pagelayout/scripts/pagelayoutapi b/macros/latex/contrib/pagelayout/scripts/pagelayoutapi
index 4c6888a249..7533cf722e 100755
--- a/macros/latex/contrib/pagelayout/scripts/pagelayoutapi
+++ b/macros/latex/contrib/pagelayout/scripts/pagelayoutapi
@@ -13,7 +13,7 @@
# LaTeX version 2008/05/04 or later.
#
-version=1.0.4
+version=1.0.5
_convert() {
turbo=$1
@@ -100,6 +100,17 @@ getwidth() {
fi
}
+getheight() {
+ if command -v magick >/dev/null 2>&1; then
+ filename=$1
+
+ originalheight=$( magick identify -ping -format %h "$filename" )
+ echo $originalheight
+ else
+ echo errormagicknotinstalled
+ fi
+}
+
optimize() {
if command -v magick >/dev/null 2>&1; then
filenamecache=$2
@@ -299,6 +310,7 @@ batchoptimize() {
usage() {
cat <<HELP_USAGE
usage: pagelayoutapi getwidth % FILE
+ pagelayoutapi getheight % FILE
pagelayoutapi optimize % FILE % FILENAME % EXTENSION % ORIGINALWIDTH
% ORIGINALHEIGHT % CROPLEFT % CROPRIGHT % CROPTOP % CROPBOTTOM
% DENSITY % WIDTH % HEIGHT % DOWNSAMPLETHRESHOLD % UNSHARP % QUALITY
@@ -327,6 +339,11 @@ getwidth)
getwidth "$1"
;;
+getheight)
+ shift
+
+ getheight "$1"
+ ;;
optimize)
shift