--- ray/src/px/ttyimage.c 1990/01/25 08:28:36 1.5 +++ ray/src/px/ttyimage.c 1991/11/12 16:05:29 2.1 @@ -1,4 +1,4 @@ -/* Copyright (c) 1986 Regents of the University of California */ +/* Copyright (c) 1991 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; @@ -13,6 +13,7 @@ static char SCCSid[] = "$SunId$ LBL"; #include #include "color.h" +#include "resolu.h" #define NCOLS 133 @@ -34,11 +35,10 @@ char **argv; exit(1); } - /* discard header */ - getheader(input, NULL); /* get picture dimensions */ - if (fgetresolu(&xres, &yres, input) != (YMAJOR|YDECR)) { - fprintf(stderr, "%s: bad picture size\n", argv[0]); + if (checkheader(input, COLRFMT, NULL) < 0 || + fgetresolu(&xres, &yres, input) < 0) { + fprintf(stderr, "%s: bad picture format\n", argv[0]); exit(1); } if (xres > NCOLS) { @@ -51,7 +51,7 @@ char **argv; fprintf(stderr, "%s: read error\n", argv[0]); exit(1); } - normcolrs(scanline, xres); + normcolrs(scanline, xres, 0); for (j = 0; j < xres; j++) putchar(shade(scanline[j])); putchar('\n');