Subject: Re: TIFF I/O, netpbm
From: [email-masked] (Mumit Khan)

30 Oct 1998 19:47:26 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
To: "Stephen E. Schweibinz" <[email-masked]>
Cc: [email-masked]

"Stephen E. Schweibinz" <[email-masked]> 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
"[email-masked]" with one line of text: "help".