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

Comparing ray/src/px/pcompos.c (file contents):
Revision 1.5 by greg, Thu Sep 14 09:20:36 1989 UTC vs.
Revision 1.6 by greg, Thu Apr 18 14:35:19 1991 UTC

# Line 43 | Line 43 | struct {
43  
44   int  nfile;                     /* number of files */
45  
46 + int  wrongformat = 0;
47  
48 +
49   tabputs(s)                      /* print line preceded by a tab */
50   char  *s;
51   {
52 <        putc('\t', stdout);
53 <        fputs(s, stdout);
52 >        char  fmt[32];
53 >
54 >        if (isformat(s)) {
55 >                formatval(fmt, s);
56 >                wrongformat = strcmp(fmt, COLRFMT);
57 >        } else {
58 >                putc('\t', stdout);
59 >                fputs(s, stdout);
60 >        }
61   }
62  
63  
# Line 130 | Line 139 | getfile:
139                  an++;
140                                                  /* get header */
141                  printf("%s:\n", input[nfile].name);
142 <                getheader(input[nfile].fp, tabputs);
142 >                getheader(input[nfile].fp, tabputs, NULL);
143 >                if (wrongformat) {
144 >                        fprintf(stderr, "%s: not a Radiance picture\n",
145 >                                        input[nfile].name);
146 >                        quit(1);
147 >                }
148                                                  /* get picture size */
149                  if (fgetresolu(&input[nfile].xres, &input[nfile].yres,
150                                  input[nfile].fp) != (YMAJOR|YDECR)) {
# Line 155 | Line 169 | getfile:
169                  ysiz = ymax;
170                                          /* add new header info. */
171          printargs(argc, argv, stdout);
172 +        fputformat(COLRFMT, stdout);
173          printf("\n-Y %d +X %d\n", ysiz, xsiz);
174  
175          compos();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines