about summary refs log tree commit diff
path: root/converter
diff options
context:
space:
mode:
Diffstat (limited to 'converter')
-rwxr-xr-xconverter/other/anytopnm2
-rw-r--r--converter/other/pamtohtmltbl.c6
-rw-r--r--converter/pbm/pbmtogo.c5
-rw-r--r--converter/ppm/tgatoppm.c2
-rw-r--r--converter/ppm/xvminitoppm.c5
5 files changed, 17 insertions, 3 deletions
diff --git a/converter/other/anytopnm b/converter/other/anytopnm
index 7422a87f..82f57b3b 100755
--- a/converter/other/anytopnm
+++ b/converter/other/anytopnm
@@ -531,7 +531,7 @@ putInputIntoTempfile "$inputFile" "$file"
 
 setMimeType "$file"
 
-typeDescription=`file "$file" | cut -d: -f2- | cut -c2`
+typeDescription=`file "$file" | cut -d: -f2- | cut -c2-`
 
 determineType "$file" "$mimeType" "$typeDescription" "$fileExtension"
 
diff --git a/converter/other/pamtohtmltbl.c b/converter/other/pamtohtmltbl.c
index 293badcb..0afbfea0 100644
--- a/converter/other/pamtohtmltbl.c
+++ b/converter/other/pamtohtmltbl.c
@@ -180,9 +180,15 @@ allocOutputtedArray(unsigned int const width, unsigned int const height) {
         pm_error("Unable to allocate space for 'outputted' array");
 
     for (row = 0; row < height; ++row) {
+        unsigned int col;
+
         MALLOCARRAY(outputted[row], width);
         if (outputted[row] == NULL)
             pm_error("Unable to allocate space for 'outputted' array");
+
+        for (col = 0; col < width ; ++col)
+          outputted[row][col] = FALSE;
+
     }
     return outputted;
 }
diff --git a/converter/pbm/pbmtogo.c b/converter/pbm/pbmtogo.c
index 67fe5821..e10fb2ff 100644
--- a/converter/pbm/pbmtogo.c
+++ b/converter/pbm/pbmtogo.c
@@ -88,6 +88,11 @@ main( argc, argv )
       ifp = stdin;
 
     pbm_readpbminit(ifp, &cols, &rows, &format);
+
+    if (cols > 1056)
+        pm_error("Image is wider (%u pixels) than a Graphon terminal "
+                 "(%u pixels)", cols, 1056);
+
     bitrow = pbm_allocrow(cols);
 
     /* Round cols up to the nearest multiple of 8. */
diff --git a/converter/ppm/tgatoppm.c b/converter/ppm/tgatoppm.c
index 19d8b347..da1c3beb 100644
--- a/converter/ppm/tgatoppm.c
+++ b/converter/ppm/tgatoppm.c
@@ -73,7 +73,7 @@ parseCommandLine(int argc, char ** argv,
         /* Uses and sets argc, argv, and some of *cmdlineP and others. */
 
     if (argc - 1 == 0)
-        cmdlineP->input_filename = "=";  /* he wants stdin */
+        cmdlineP->input_filename = "-";  /* he wants stdin */
     else if (argc - 1 == 1)
         cmdlineP->input_filename = strdup(argv[1]);
     else 
diff --git a/converter/ppm/xvminitoppm.c b/converter/ppm/xvminitoppm.c
index e5bdac7d..16626bc2 100644
--- a/converter/ppm/xvminitoppm.c
+++ b/converter/ppm/xvminitoppm.c
@@ -129,6 +129,9 @@ readXvHeader(FILE *         const ifP,
                  "It does not consist of 3 decimal numbers.", buf);
     if (maxval != 255)
         pm_error("bogus XV thumbnail maxval %u.  Should be 255", maxval);
+    *colsP = cols;
+    *rowsP = rows;
+    *maxvalP = maxval;
 }
 
 
@@ -162,7 +165,7 @@ writePpm(FILE *             const ifP,
                 pm_error("unexpected EOF");
             else {
                 unsigned int const paletteIndex = byte;
-                assert(byte > 0);
+                assert(byte >= 0);
                 
                 PPM_ASSIGN(pixrow[col],
                            xvPaletteP->red[paletteIndex],