about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-01-19 04:18:07 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-01-19 04:18:07 +0000
commit808c9d79ad2caa5f0891b723ade83988af11978f (patch)
treee162af186b73fb188f18a65ac3f7eb2064bd631f
parent71f0a053398f645c3bf92429f5bee8d21da25aa6 (diff)
downloadnetpbm-mirror-808c9d79ad2caa5f0891b723ade83988af11978f.tar.gz
netpbm-mirror-808c9d79ad2caa5f0891b723ade83988af11978f.tar.xz
netpbm-mirror-808c9d79ad2caa5f0891b723ade83988af11978f.zip
Accept -halign with -left, -right, and -mwidth
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4248 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-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) )