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

Comparing ray/src/util/rcrop.c (file contents):
Revision 1.4 by greg, Tue Mar 15 02:28:05 2022 UTC vs.
Revision 1.7 by greg, Tue Mar 15 20:21:18 2022 UTC

# Line 234 | Line 234 | main(int argc, char *argv[])
234                  fputs(": cannot open for writing\n", stderr);
235                  return(1);
236          }
237 + #ifdef getc_unlocked            /* avoid stupid semaphores */
238 +        flockfile(fp);
239 +        flockfile(stdout);
240 + #endif
241                                  /* process information header */
242          if (getheader(fp, headline, NULL) < 0) {
243                  fputs(progname, stderr);
# Line 316 | Line 320 | main(int argc, char *argv[])
320                  asiz = sizeof(float);
321          } else if (!strcmp(fmt, "double")) {
322                  asiz = sizeof(double);
323 +        } else if (!strcmp(fmt, "32-bit_encoded_normal")) {
324 +                asiz = 4;
325 +                ncomp = 1;
326 +        } else if (!strcmp(fmt, "16-bit_encoded_depth")) {
327 +                asiz = 2;
328 +                ncomp = 1;
329          } else if (globmatch(PICFMT, fmt)) {
330                  asiz = -1;
331                  if (!ncomp) ncomp = 3;
# Line 335 | Line 345 | main(int argc, char *argv[])
345          if (!(asiz < 0 ? colr_copyf(fp) :
346                          !asiz ? ascii_copyf(fp) : binary_copyf(fp, asiz)))
347                  return(1);
348 +                                        /* need to consume the rest? */
349 +        if (fp == stdin && rmin+nrows < numscans(&res) &&
350 +                        fseek(fp, 0L, SEEK_END) < 0)
351 +                while (getc(fp) != EOF)
352 +                        ;
353          return(0);
354   usage:
355          fputs("Usage: ", stderr);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines