about summary refs log tree commit diff
path: root/editor
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2012-12-04 17:05:56 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2012-12-04 17:05:56 +0000
commit6c91abbb532afb5186ab2307fb1ef0033f58b1f1 (patch)
treeb796d32c36ca563ce7ff6c9125c10c922c67250c /editor
parente7699067fce588bb8ac3172f19783db2b3b87990 (diff)
downloadnetpbm-mirror-6c91abbb532afb5186ab2307fb1ef0033f58b1f1.tar.gz
netpbm-mirror-6c91abbb532afb5186ab2307fb1ef0033f58b1f1.tar.xz
netpbm-mirror-6c91abbb532afb5186ab2307fb1ef0033f58b1f1.zip
Release 10.47.42
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@1799 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor')
-rw-r--r--editor/pnmmontage.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/editor/pnmmontage.c b/editor/pnmmontage.c
index 4ccff497..2e30a43b 100644
--- a/editor/pnmmontage.c
+++ b/editor/pnmmontage.c
@@ -108,7 +108,7 @@ parseCommandLine(int argc, const char ** argv,
             pm_error("Filename '%s' contains a \":\", which is forbidden "
                      "with -data", argv[i+1]);
         else
-            cmdlineP->inFileName[i] = strdup(argv[1+1]);
+            cmdlineP->inFileName[i] = strdup(argv[i+1]);
     }
 }
 
@@ -366,6 +366,21 @@ adjustMaxval(tuple *            const tuplerow,
 
 
 static void
+makeRowBlack(struct pam * const pamP,
+             tuple *      const tuplerow) {
+
+    unsigned int col;
+
+    for (col = 0; col < pamP->width; ++col) {
+        unsigned int plane;
+        for (plane = 0; plane < pamP->depth; ++plane)
+            tuplerow[col][plane] = 0;
+    }
+}
+
+
+
+static void
 writePam(struct pam *       const outpamP,
          unsigned int       const nfiles,
          const coord *      const coords,
@@ -380,6 +395,9 @@ writePam(struct pam *       const outpamP,
 
     for (i = 0; i < outpamP->height; ++i) {
         int j;
+
+        makeRowBlack(outpamP, tuplerow);  /* initial value */
+
         for (j = 0; j < nfiles; ++j) {
             if (coords[j].y <= i && i < coords[j].y + imgs[j].height) {
                 pnm_readpamrow(&imgs[j], &tuplerow[coords[j].x]);
@@ -631,11 +649,10 @@ main(int argc, const char **argv) {
     pnm_setminallocationdepth(&outimg, outimg.depth);
 
     outimg.size = sizeof(outimg);
-    outimg.len = sizeof(outimg);
+    outimg.len = PAM_STRUCT_SIZE(allocation_depth);
+    pnm_setminallocationdepth(&outimg, outimg.depth);
+    outimg.plainformat = false;
     outimg.file = stdout;
-    outimg.bytes_per_sample = 0;
-    for (i = outimg.maxval; i; i >>= 8)
-        ++outimg.bytes_per_sample;
  
     writePam(&outimg, nfiles, coords, imgs);