ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/glareval.c
(Generate patch)

Comparing ray/src/util/glareval.c (file contents):
Revision 1.12 by greg, Fri Apr 12 10:28:34 1991 UTC vs.
Revision 1.13 by greg, Thu Apr 18 15:18:25 1991 UTC

# Line 50 | Line 50 | static SCAN    *hashtab[HSIZE];        /* scanline hash table */
50   static long     ncall = 0L;     /* number of calls to getpictscan */
51   static long     nread = 0L;     /* number of scanlines read */
52  
53 + static int      wrongformat = 0;
54 +
55   SCAN    *scanretire();
56  
57   extern long     ftell();
# Line 290 | Line 292 | int    np;
292   getexpos(s)                     /* get exposure from header line */
293   char    *s;
294   {
295 +        char    fmt[32];
296 +
297          if (isexpos(s))
298                  exposure *= exposval(s);
299 +        else if (isformat(s)) {
300 +                formatval(fmt, s);
301 +                wrongformat = strcmp(fmt, COLRFMT);
302 +        }
303   }
304  
305  
# Line 303 | Line 311 | char   *fn;
311                  exit(1);
312          }
313          exposure = 1.0;
314 <        getheader(pictfp, getexpos);
315 <        if (fgetresolu(&pxsiz, &pysiz, pictfp) != (YMAJOR|YDECR)) {
316 <                fprintf("%s: bad picture resolution\n", fn);
314 >        getheader(pictfp, getexpos, NULL);
315 >        if (wrongformat ||
316 >                        fgetresolu(&pxsiz, &pysiz, pictfp) != (YMAJOR|YDECR)) {
317 >                fprintf("%s: bad picture format\n", fn);
318                  exit(1);
319          }
320          initscans();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines