--- ray/src/px/pfilt.c 1990/12/14 16:33:16 1.15 +++ ray/src/px/pfilt.c 1991/06/05 12:15:30 1.17 @@ -53,6 +53,8 @@ int xres, yres; /* resolution of input */ double inpaspect = 1.0; /* pixel aspect ratio of input */ int correctaspect = 0; /* aspect ratio correction? */ +int wrongformat = 0; + int xrad; /* x window size */ int yrad; /* y window size */ @@ -227,7 +229,12 @@ char **argv; quit(1); } /* get header */ - getheader(fin, headline); + getheader(fin, headline, NULL); + if (wrongformat) { + fprintf(stderr, "%s: input must be a Radiance picture\n", + progname); + quit(1); + } /* add new header info. */ printargs(i, argv, stdout); /* get picture size */ @@ -273,9 +280,15 @@ char **argv; headline(s) /* process line from header */ char *s; { + char fmt[32]; + fputs(s, stdout); /* copy to output */ if (isaspect(s)) /* get aspect ratio */ inpaspect *= aspectval(s); + else if (isformat(s)) { + formatval(fmt, s); + wrongformat = strcmp(fmt, COLRFMT); + } } @@ -390,7 +403,7 @@ scan2init() /* prepare scanline arrays */ initmask(); /* initialize filter table */ } - barsize = 2 * yrad; + barsize = 2*yrad + 1; scanin = (COLOR **)malloc(barsize*sizeof(COLOR *)); for (i = 0; i < barsize; i++) { scanin[i] = (COLOR *)malloc(xres*sizeof(COLOR));