groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 06/07: [pdfpic]: Fix Savannah #58206.


From: G. Branden Robinson
Subject: [groff] 06/07: [pdfpic]: Fix Savannah #58206.
Date: Fri, 21 Jan 2022 04:48:28 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 1483e1168224e9d37ff0986ccf5e3346af7e9281
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Jan 21 20:38:19 2022 +1100

    [pdfpic]: Fix Savannah #58206.
    
    * tmac/pdfpic.tmac (PDFPIC): Scrub null bytes out of pdfinfo(1) output.
      Thanks to an anonymous contributor for the patch (the commentary about
      it is mine, if someone wants an argument).
    
    Fixes <https://savannah.gnu.org/bugs/?58206>.
---
 ChangeLog        | 10 ++++++++++
 tmac/pdfpic.tmac |  5 ++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 76d54986..e142662a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2022-01-21  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [pdfpic]: Fix Savannah #58206.
+
+       * tmac/pdfpic.tmac (PDFPIC): Scrub null bytes out of pdfinfo(1)
+       output.  Thanks to an anonymous contributor for the patch (the
+       commentary about it is mine, if someone wants an argument).
+
+       Fixes <https://savannah.gnu.org/bugs/?58206>.
+
 2022-01-21  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [pdfpic]: Regression-test Savannah #58206.
diff --git a/tmac/pdfpic.tmac b/tmac/pdfpic.tmac
index c2159674..46228fb6 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\



reply via email to

[Prev in Thread] Current Thread [Next in Thread]