--- ray/src/px/ra_tiff.c 2008/11/10 19:08:19 2.33 +++ ray/src/px/ra_tiff.c 2019/07/19 17:37:56 2.36 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: ra_tiff.c,v 2.33 2008/11/10 19:08:19 greg Exp $"; +static const char RCSid[] = "$Id: ra_tiff.c,v 2.36 2019/07/19 17:37:56 greg Exp $"; #endif /* * Program to convert between RADIANCE and TIFF files. @@ -7,12 +7,11 @@ static const char RCSid[] = "$Id: ra_tiff.c,v 2.33 200 * Added white-balance adjustment 10/01 (GW). */ -#include #include #include -#include -#include +#include "rtio.h" +#include "platform.h" #include "tiffio.h" #include "color.h" #include "resolu.h" @@ -415,6 +414,7 @@ tiff2ra( /* convert TIFF image to Radiance picture */ cvts.rfp = stdout; else if ((cvts.rfp = fopen(av[ac+1], "w")) == NULL) quiterr("cannot open Radiance output picture"); + SET_FILE_BINARY(cvts.rfp); /* start output header */ newheader("RADIANCE", cvts.rfp); printargs(ac, av, cvts.rfp); @@ -440,7 +440,7 @@ headline( /* process Radiance input header line */ { static int tmstrlen = 0; static int ownstrlen = 0; - char fmt[32]; + char fmt[MAXFMTLEN]; if (!tmstrlen) tmstrlen = strlen(TMSTR); @@ -634,6 +634,7 @@ ra2tiff( /* convert Radiance picture to TIFF image */ cvts.rfp = stdin; else if ((cvts.rfp = fopen(av[ac], "r")) == NULL) quiterr("cannot open Radiance input picture"); + SET_FILE_BINARY(cvts.rfp); /* open TIFF file */ if ((cvts.tif = TIFFOpen(av[ac+1], "w")) == NULL) quiterr("cannot open TIFF output");