From: khan@xraylith.wisc.edu (Mumit Khan)
Subject: Re: TIFF I/O, netpbm
30 Oct 1998 19:47:26 -0800
Message-ID: <9810300436.AA00893.cygnus.gnu-win32@modi.xraylith.wisc.edu>
References: <199810290228.VAA28025@department-of-alchemy.mit.edu>
To: "Stephen E. Schweibinz" <plan@mit.edu>
Cc: gnu-win32@cygnus.com

"Stephen E. Schweibinz" <plan@mit.edu> writes:
> 
> 
> However the output TIFF file cannot be opened properly in a viewer.
> I have a feeling I need to add the following
> 
> setmode(fileno(stdout), O_BINARY);
> 
> where the output of the TIFF is occuring, but I am not sure where
> I should stick this line or if this is even the problem.  

Do yourself a favor and simply add a '--output ofile' or '-o ofile'
option and just use that instead of writing to standard output. 
Make life a little easier (that patch I had sent had an example of
that -- see ppm_openw).

If you want to use file redirection or piping and get the right output,
you'll need to do what you suggest above. Just stick the setmode before 
any write to stdout.
  
  fflush (stdout);
  setmode (fileno (stdout), O_BINARY);

or, you can use binary mounts.

Regards,
Mumit

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
