delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/10/30/19:47:26

From: khan AT xraylith DOT wisc DOT 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 DOT VAA28025 AT department-of-alchemy DOT mit DOT edu>
To: "Stephen E. Schweibinz" <plan AT mit DOT edu>
Cc: gnu-win32 AT cygnus DOT com

"Stephen E. Schweibinz" <plan AT mit DOT 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 AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019