--- ray/src/px/glimage.c 1990/01/26 08:18:38 1.2 +++ ray/src/px/glimage.c 1991/11/13 11:08:36 2.1 @@ -16,7 +16,9 @@ static char SCCSid[] = "$SunId$ LBL"; #include "color.h" +#include "resolu.h" + main(argc, argv) /* print a picture */ int argc; char *argv[]; @@ -39,9 +41,12 @@ char *argv[]; exit(1); } /* discard header */ - getheader(input, NULL); + if (checkheader(input, COLRFMT, NULL) < 0) { + fprintf(stderr, "%s: not a Radiance picture\n", fname); + exit(1); + } /* get picture dimensions */ - if (fgetresolu(&xres, &yres, input) != (YMAJOR|YDECR)) { + if (fgetresolu(&xres, &yres, input) < 0) { fprintf(stderr, "%s: bad picture size\n", fname); exit(1); }