summaryrefslogtreecommitdiff
path: root/tmac/pdfpic.tmac
diff options
context:
space:
mode:
Diffstat (limited to 'tmac/pdfpic.tmac')
-rw-r--r--tmac/pdfpic.tmac5
1 files changed, 4 insertions, 1 deletions
diff --git a/tmac/pdfpic.tmac b/tmac/pdfpic.tmac
index c2159674b..46228fb69 100644
--- a/tmac/pdfpic.tmac
+++ b/tmac/pdfpic.tmac
@@ -118,9 +118,12 @@
. return
. \}
.
-. \" get image dimensions
+. \" Get image dimensions. The `tr` command to strip null bytes is
+. \" distasteful, but its necessity is imposed on us. See
+. \" <https://gitlab.freedesktop.org/poppler/poppler/-/issues/776>.
. ec @
. sy pdfinfo @$1 | \
+tr -d '\000' | \
grep "Page *size" | \
sed -e 's/Page *size: *\\([[:digit:].]*\\) *x *\\([[:digit:].]*\\).*$/\
.nr pdfpic*width (p;\\1)\\n\