--- ray/src/util/rcrop.c 2022/03/15 02:28:05 1.4 +++ ray/src/util/rcrop.c 2022/03/15 15:01:22 1.6 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rcrop.c,v 1.4 2022/03/15 02:28:05 greg Exp $"; +static const char RCSid[] = "$Id: rcrop.c,v 1.6 2022/03/15 15:01:22 greg Exp $"; #endif /* * rcrop.c - crop a Radiance picture or matrix data @@ -316,6 +316,12 @@ main(int argc, char *argv[]) asiz = sizeof(float); } else if (!strcmp(fmt, "double")) { asiz = sizeof(double); + } else if (!strcmp(fmt, "32-bit_encoded_normal")) { + asiz = 4; + ncomp = 1; + } else if (!strcmp(fmt, "16-bit_encoded_depth")) { + asiz = 2; + ncomp = 1; } else if (globmatch(PICFMT, fmt)) { asiz = -1; if (!ncomp) ncomp = 3; @@ -335,6 +341,11 @@ main(int argc, char *argv[]) if (!(asiz < 0 ? colr_copyf(fp) : !asiz ? ascii_copyf(fp) : binary_copyf(fp, asiz))) return(1); + /* need to consume the rest? */ + if (fp == stdin && rmin+nrows < numscans(&res) && + fseek(fp, 0L, SEEK_END) < 0) + while (getc(fp) != EOF) + ; return(0); usage: fputs("Usage: ", stderr);