--- ray/src/px/mt160r.c 1989/10/20 20:35:59 1.4 +++ ray/src/px/mt160r.c 1991/04/18 14:35:09 1.7 @@ -39,7 +39,6 @@ char *fname; FILE *input; int xres, yres; COLR scanline[NCOLS]; - char sbuf[256]; int i; if (fname == NULL) { @@ -50,8 +49,10 @@ char *fname; return(-1); } /* discard header */ - while (fgets(sbuf, sizeof(sbuf), input) != NULL && sbuf[0] != '\n') - ; + if (checkheader(input, COLRFMT, NULL) < 0) { + fprintf(stderr, "%s: not a Radiance picture\n", fname); + return(-1); + } /* get picture dimensions */ if (fgetresolu(&xres, &yres, input) != (YMAJOR|YDECR)) { fprintf(stderr, "%s: bad picture size\n", fname); @@ -69,7 +70,7 @@ char *fname; fprintf(stderr, "%s: read error (y=%d)\n", fname, i); return(-1); } - normcolrs(scanline, xres); + normcolrs(scanline, xres, 0); plotscan(scanline, xres, i); }