about summary refs log tree commit diff
path: root/other
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-08-02 16:39:58 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-08-02 16:39:58 +0000
commit12e756e13c55c9e8c1923386b36319e3018c83c7 (patch)
tree2b89315d3ecb3ddba3b0d701ec2958b2e75f5475 /other
parent36ecd14e84ea759f0336ddc60e20fa02290f38f4 (diff)
downloadnetpbm-mirror-12e756e13c55c9e8c1923386b36319e3018c83c7.tar.gz
netpbm-mirror-12e756e13c55c9e8c1923386b36319e3018c83c7.tar.xz
netpbm-mirror-12e756e13c55c9e8c1923386b36319e3018c83c7.zip
Fix wrong maxval with -lcmmaxval, failure to fail when maxvals are different an no options gives
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4569 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'other')
-rw-r--r--other/pamstack.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/other/pamstack.c b/other/pamstack.c
index 75b66cb7..3f974a3a 100644
--- a/other/pamstack.c
+++ b/other/pamstack.c
@@ -236,8 +236,8 @@ processOneImageInAllStreams(unsigned int       const nInput,
         if (inpam[inputSeq].maxval != inpam[0].maxval)
             allImagesSameMaxval = false;
 
-        maxvalLcm = pm_lcm(maxvalLcm, inpam[inputSeq].maxval, 1,
-                           PAM_OVERALL_MAXVAL);
+        maxvalLcm = pm_lcm(maxvalLcm + 1, inpam[inputSeq].maxval + 1, 1,
+                           PAM_OVERALL_MAXVAL) - 1;
 
         outputDepth += inpam[inputSeq].depth;
     }
@@ -247,9 +247,8 @@ processOneImageInAllStreams(unsigned int       const nInput,
     switch (maxvalScaling) {
     case MAXVALSCALE_NONE:
         if (!allImagesSameMaxval)
-            pm_message("Inputs do not all have same maxval.  "
-                       "Consider -firstmaxval or -lcmmaxval");
-        outpam.maxval = inpam[0].maxval;
+            pm_error("Inputs do not all have same maxval.  "
+                     "Consider -firstmaxval or -lcmmaxval");
         break;
     case MAXVALSCALE_FIRST:
         outpam.maxval = inpam[0].maxval;