about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/HISTORY4
-rw-r--r--editor/pnmpad.c7
2 files changed, 8 insertions, 3 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index e58e690b..cfcd78c3 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -20,6 +20,10 @@ not yet  BJH  Release 10.98.00
               ppmtoilbm: Fix wild memory references and hangs with -map .
               Introduced in Netpbm 9.12 (March 2001).
 
+              pnmpad: Fix rejection of -halign along with -left, -right, and
+              -mwidth.  And analogous vertical padding case.  Introduced in
+              Netpbm 10.97 (December 2021).
+              
               Remove Floyd-Steinberg dithering functions (ppm_fs_*) from
               libnetpbm (libppmfloyd).  No longer used.  Floyd-Steinberg
               dithering logic can be found in pnmremap.  libppmfloyd
diff --git a/editor/pnmpad.c b/editor/pnmpad.c
index 9fa9f9e6..02dc32e7 100644
--- a/editor/pnmpad.c
+++ b/editor/pnmpad.c
@@ -128,10 +128,11 @@ parseCommandLine(int argc, const char ** argv,
     if (cmdlineP->ysizeSpec > 1)
        pm_error("You can specify -height only once");
 
-    if (xalignSpec && (cmdlineP->leftSpec || cmdlineP->rightSpec))
+    if (xalignSpec && (cmdlineP->leftSpec || cmdlineP->rightSpec)
+	           && !mwidthSpec)
         pm_error("You cannot specify both -halign and -left or -right");
-
-    if (yalignSpec && (cmdlineP->topSpec || cmdlineP->bottomSpec))
+    if (yalignSpec && (cmdlineP->topSpec || cmdlineP->bottomSpec)
+	           && !mheightSpec)
         pm_error("You cannot specify both -valign and -top or -bottom");
 
     if (xalignSpec && (!cmdlineP->xsizeSpec && !mwidthSpec) )