about summary refs log tree commit diff
path: root/editor
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-12-19 19:12:58 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-12-19 19:12:58 +0000
commit3fab8bec74da5e265ee304a7f4b191d3cf4734a7 (patch)
treec10e1640cb5ac6b6292587414bf4c1353b498818 /editor
parentfb38ea53371d1dab1bcc72411b058134db8d425c (diff)
downloadnetpbm-mirror-3fab8bec74da5e265ee304a7f4b191d3cf4734a7.tar.gz
netpbm-mirror-3fab8bec74da5e265ee304a7f4b191d3cf4734a7.tar.xz
netpbm-mirror-3fab8bec74da5e265ee304a7f4b191d3cf4734a7.zip
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4814 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor')
-rw-r--r--editor/specialty/pnmindex.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/editor/specialty/pnmindex.c b/editor/specialty/pnmindex.c
index d6c1764d..5e71b27b 100644
--- a/editor/specialty/pnmindex.c
+++ b/editor/specialty/pnmindex.c
@@ -685,13 +685,27 @@ rowFileList(const char * const dirName,
 
 
 static void
-writeRowsAndDelete(unsigned int const rows,
+writeRowsAndDelete(unsigned int const rowCt,
                    int          const maxFormatType,
                    bool         const blackBackground,
                    bool         const quant,
                    unsigned int const colorCt,
                    const char * const tempDir) {
+/*----------------------------------------------------------------------------
+   Write the PNM image containing the 'rowCt' rows of thumbnails to Standard
+   Output.  Take each row of thumbnails from a specially named PNM file in
+   directory 'tempDir', and unlink it from that directory.
+
+   Where the rows are different widths, pad with black if 'blackBackground'
+   is true; white otherwise.
 
+   If 'quant', color-quantize the result to have no more than 'colorCt'
+   colors, choosing the colors that best represent all the pixels in the
+   result.
+
+   'maxFormatType' is the most expressive format of all the row files; results
+   are undefined if it is not.
+-----------------------------------------------------------------------------*/
     const char * const blackWhiteOpt = blackBackground ? "-black" : "-white";
     const char * const plainOpt      = pm_plain_output ? "-plain" : "";
 
@@ -705,7 +719,7 @@ writeRowsAndDelete(unsigned int const rows,
     else
         quantStage = strdup("");
 
-    fileList = rowFileList(tempDir, rows);
+    fileList = rowFileList(tempDir, rowCt);
 
     pm_asprintf(&shellCommand, "pamcat %s %s -topbottom %s %s",
                 plainOpt, blackWhiteOpt, fileList, quantStage);
@@ -721,13 +735,13 @@ writeRowsAndDelete(unsigned int const rows,
     if (termStatus != 0)
         pm_error("Shell command '%s' to assemble %u rows of thumbnails and "
                  "write them out failed; termination status = %d",
-                 shellCommand, rows, termStatus);
+                 shellCommand, rowCt, termStatus);
 
     pm_strfree(shellCommand);
     pm_strfree(fileList);
     pm_strfree(quantStage);
 
-    unlinkRowFiles(tempDir, rows);
+    unlinkRowFiles(tempDir, rowCt);
 }