about summary refs log tree commit diff
path: root/generator
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-12-24 02:40:43 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-12-24 02:40:43 +0000
commit53b8f1a7e6c4210aa67e3028099300b486559543 (patch)
treeddb2eeb1929da57062056404356838160db2ece8 /generator
parent470372222f011c15be1b03f179ed0a26a5875830 (diff)
downloadnetpbm-mirror-53b8f1a7e6c4210aa67e3028099300b486559543.tar.gz
netpbm-mirror-53b8f1a7e6c4210aa67e3028099300b486559543.tar.xz
netpbm-mirror-53b8f1a7e6c4210aa67e3028099300b486559543.zip
Release 10.35.91
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@2077 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'generator')
-rw-r--r--generator/pamgauss.c2
-rw-r--r--generator/ppmpat.c15
2 files changed, 16 insertions, 1 deletions
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(