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

Comparing ray/src/common/depthcodec.c (file contents):
Revision 2.12 by greg, Thu Mar 3 16:09:31 2022 UTC vs.
Revision 2.13 by greg, Thu Sep 22 21:45:28 2022 UTC

# Line 80 | Line 80 | headline(char *s, void *p)
80                  dcp->swapped = (nativebigendian() != rv);
81                  return 0;
82          }
83 <                                        /* check for reference depth */
83 >        if (!strncmp(s, "NCOMP=", 6)) {
84 >                if (atoi(s+6) != 1) {
85 >                        if (dcp->hdrflags & HF_STDERR) {
86 >                                fputs(dcp->inpname, stderr);
87 >                                fputs(": NCOMP must equal 1\n", stderr);
88 >                        }
89 >                        return -1;
90 >                }
91 >                return 0;
92 >        }
93 >        if (!strncmp(s, "NROWS=", 6)) {
94 >                dcp->res.yr = atoi(s+6);
95 >                return 0;
96 >        }
97 >        if (!strncmp(s, "NCOLS=", 6)) {
98 >                dcp->res.xr = atoi(s+6);
99 >                return 0;
100 >        }
101 >                                                /* check for reference depth */
102          if (!strncmp(s, DEPTHSTR, LDEPTHSTR)) {
103                  char    *cp;
104                  strlcpy(dcp->depth_unit, s+LDEPTHSTR, sizeof(dcp->depth_unit));
# Line 123 | Line 141 | process_dc_header(DEPTHCODEC *dcp, int ac, char *av[])
141          }
142          dcp->gotview *= (dcp->gotview > 0);
143                                          /* get resolution string? */
144 <        if (dcp->hdrflags & HF_RESIN && !fgetsresolu(&dcp->res, dcp->finp)) {
144 >        if (dcp->hdrflags & HF_RESIN &&
145 >                        (dcp->res.xr <= 0) | (dcp->res.yr <= 0) &&
146 >                        !fgetsresolu(&dcp->res, dcp->finp)) {
147                  if (dcp->hdrflags & HF_STDERR) {
148                          fputs(dcp->inpname, stderr);
149                          fputs(": bad resolution string\n", stderr);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines