This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: TIFF I/O, netpbm


"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".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]