about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Makefile.version2
-rw-r--r--converter/pbm/pbmtoepsi.c22
-rw-r--r--doc/HISTORY17
-rw-r--r--editor/pnmshear.c5
-rw-r--r--generator/pamgauss.c2
-rw-r--r--generator/ppmpat.c15
6 files changed, 55 insertions, 8 deletions
diff --git a/Makefile.version b/Makefile.version
index 2d87f56c..451fc509 100644
--- a/Makefile.version
+++ b/Makefile.version
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 35
-NETPBM_POINT_RELEASE = 90
+NETPBM_POINT_RELEASE = 91
diff --git a/converter/pbm/pbmtoepsi.c b/converter/pbm/pbmtoepsi.c
index fc8cee7d..81e03fbe 100644
--- a/converter/pbm/pbmtoepsi.c
+++ b/converter/pbm/pbmtoepsi.c
@@ -150,6 +150,13 @@ findPrincipalImage(bit ** const bits,
             }
         }
     }
+
+    if(bottom == -MAXINT) {  /* No black pixels encountered */ 
+        pm_message("Blank page");
+        top = left = 0;
+        bottom = rows-1;  right = cols-1;
+	}
+
     *topP = top;
     *bottomP = bottom;
     *leftP = left;
@@ -237,13 +244,20 @@ main(int argc, char * argv[]) {
 
         for (row = top; row <= bottom; row++) {
             int col;
+	    int outChars = 2;
+	    printf("%% ");
 
-            printf("%% ");
+            for (col = left; col <= right; col += 8) {
+                if (outChars == 72) {
+		  printf("\n%% ");
+                  outChars = 2;
+		}  
 
-            for (col = left; col <= right; col += 8) 
                 printf("%02x", eightPixels(bits, row, col, cols));
-
-            printf("\n");
+                outChars += 2;
+	    }
+	    if (outChars > 0)
+                printf("\n");
         }
         printf("%%%%EndImage\n");
         printf("%%%%EndPreview\n");
diff --git a/doc/HISTORY b/doc/HISTORY
index 9dbcc470..8dd926a1 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,23 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+13.12.24 BJH  Release 10.35.91
+
+              pbmtoepsi: fix handling of all-white image.  Always broken.
+              Thanks Prophet of the Way <afu@wta.att.ne.jp>.
+
+              pbmtoepsi: fix excessively long raster line.  Always broken.
+              Thanks Prophet of the Way <afu@wta.att.ne.jp>.
+
+              pnmshear: fix incorrect determination of background color.
+              Always broken.
+
+              ppmpat: fix crash with -squig with aspect ratio < 1:25 or
+              > 25:1. Thanks Prophet of the Way <afu@wta.att.ne.jp>.
+              Always broken.
+
+              pamgauss: Fix typo in message.
+
 13.09.26 BJH  Release 10.35.90
 
               ppmtoxpm: fix bug: ignores inability to open the specified color
diff --git a/editor/pnmshear.c b/editor/pnmshear.c
index 1b2d36a8..ae104db9 100644
--- a/editor/pnmshear.c
+++ b/editor/pnmshear.c
@@ -201,13 +201,14 @@ main(int argc, char * argv[]) {
     pnm_writepnminit( stdout, newcols, rows, newmaxval, newformat, 0 );
     newxelrow = pnm_allocrow( newcols );
 
-    bgxel = pnm_backgroundxelrow( xelrow, cols, newmaxval, format );
-
     for ( row = 0; row < rows; ++row ) {
         double shearCols;
 
         pnm_readpnmrow( ifp, xelrow, cols, newmaxval, format );
 
+        if ( row == 0 )
+            bgxel = pnm_backgroundxelrow( xelrow, cols, newmaxval, format );
+
         if ( cmdline.angle > 0.0 )
             shearCols = row * shearfac;
         else
diff --git a/generator/pamgauss.c b/generator/pamgauss.c
index 4dd932c4..2b715467 100644
--- a/generator/pamgauss.c
+++ b/generator/pamgauss.c
@@ -90,7 +90,7 @@ parseCommandLine(int argc, char ** argv,
     if (argc-1 < 2)
         pm_error("Need two arguments: width and height.");
     else if (argc-1 > 2)
-        pm_error("Only two argumeents allowed: with and height.  "
+        pm_error("Only two arguments allowed: width and height.  "
                  "You specified %d", argc-1);
     else {
         cmdlineP->width = atoi(argv[1]);
diff --git a/generator/ppmpat.c b/generator/ppmpat.c
index dc8e3bbf..89585c3e 100644
--- a/generator/ppmpat.c
+++ b/generator/ppmpat.c
@@ -650,6 +650,19 @@ static pixel sq_colors[SQ_MAXCIRCLE_POINTS];
 static int sq_xoffs[SQ_MAXCIRCLE_POINTS], sq_yoffs[SQ_MAXCIRCLE_POINTS];
 
 static void
+validateSquigAspect(unsigned int const cols,
+                    unsigned int const rows) {
+
+    if (cols / rows >= 25 || rows / cols >= 25)
+        pm_error("Image too narrow.  Aspect ratio: %u/%u=%f "
+                 "is outside accepted range: 0.04 - 25.0",
+                 cols, rows, (float)cols/rows ); 
+
+}
+
+
+
+static void
 sq_measurecircle_drawproc(pixel** const pixels, 
                           int const cols, 
                           int const rows, 
@@ -746,6 +759,8 @@ squig( pixels, cols, rows, maxval )
     pixel color;
     int i, j, xc[SQ_POINTS], yc[SQ_POINTS], x0, y0, x1, y1, x2, y2, x3, y3;
 
+    validateSquigAspect(cols, rows);
+    
     /* Clear image to black. */
     PPM_ASSIGN( color, 0, 0, 0 );
     ppmd_filledrectangle(