URL:
  <https://savannah.gnu.org/bugs/?66707>

                 Summary: some versions of pnmcrop produce spurious warnings
                   Group: GNU roff
               Submitter: barx
               Submitted: Fri 24 Jan 2025 12:45:41 PM CST
                Category: General
                Severity: 2 - Minor
              Item Group: Warning/Suspicious behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Fri 24 Jan 2025 12:45:41 PM CST By: Dave <barx>
Bug #61302 reports that users with some versions of pnmcrop see diagnostics
saying "The image is entirely background; there is nothing to crop" when
building doc/pic.html.  I also see it when building doc/webpage.html.

Deri researched this and concluded "I believe what is happening is that the
pnmcut (which precedes the pnmcrop), has actually removed all the white pixels
outside the figure, so pnmcrop has nothing to do."  Branden further noted: "It
appears that some versions of pnmcrop ignore the command's `-quiet` flag."  In
particular, Deri sees this with Netpbm 10.87.1, and I see it with Netpbm
10.70.0.

But, funny thing: my pnmcrop recognizes -quiet but does not document this.

$ pnmcrop -quiet /etc/motd
pnmcrop: bad magic number 0xa46 - not a PPM, PGM, PBM, or PAM file
$ pnmcrop -silent /etc/motd
unrecognized option '-silent'.  Recognized options are: -black -white -sides
-left -right -top -bottom -verbose -margin -borderfile

The man page similarly omits mention of -quiet.  So while the command doesn't
reject this option outright as it does other unrecognized options, the fact
that it's undocumented (and, incidentally, does nothing) makes it seem like
it's unsupported, and therefore groff's use of it with these older versions
pnmcrop is technically invalid.

The man page for Deri's 10.87.1 version of pnmcrop shows a -blank-image
option, which he thinks could also solve the problem; however, my older
(10.70.0) pnmcrop lacks this option.  But then he notes: "I am not sure
whether a call to pnmcrop is even needed, given that pnmcut has removed the
excess white pixels! I suspect it is a case of belt and braces."  (That's
"belt and suspenders" translated to American.)

If his last conjecture holds true, this suggests a way to remove the spurious
pnmcrop warning across the board.

If not, there may still be ways of addressing it with reasonably recent
pnmcrop versions.  My ancient pnmcrop (from March 2018--coming up on its 7th
birthday!) offers fewer options to get rid of the warning altogether.  The
build could suppress them, but Branden has a good reason to oppose this:
"grohtml sometimes gets confused and really does manage to produce blank
images where content should be."  So, if the pnmcrop calls turn out to not be
altogether redundant, I suggest documenting the warning in the PROBLEMS file
to inform users it's known to be (usually) harmless.







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66707>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to