AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

1997.01.22 18:31 "Reading from standard in", by Todd D. Newman
1997.01.22 20:04 "Re: Reading from standard in", by Sam Leffler
1997.01.22 21:14 "Re: Reading from standard in", by Helge Blischke
1997.01.23 00:25 "RE: Reading from standard in", by Dwight Kelly
1997.01.23 00:04 "Re: Reading from standard in", by Tom Lane
1997.01.23 02:03 "Re: Reading from standard in", by Cristy

1997.01.23 02:03 "Re: Reading from standard in", by Cristy

I'd suggest logic along the lines of copying data from stdin to a temp

This is what ImageMagick does (see below). Here is an example that accepts TIFF as STDIN and outputs a JPEG image:

  cat image.tiff | convert - image.jpg

See

  http://www.wizards.dupont.com/cristy/ImageMagick.html

for more details.

* * *

  if ((image->file == stdin) || image->pipe)
    {
      FILE
        *file;
 
      int
        c;
 
      /*
        Copy standard input or pipe to temporary file.
      */
      TemporaryFilename(image_info->filename);
      file=fopen(image_info->filename,WriteBinaryType);
      if (file == (FILE *) NULL)
        PrematureExit("Unable to write file",image);
      c=fgetc(image->file);
      while (c != EOF)
      {
        (void) putc(c,file);
        c=fgetc(image->file);
      }
      (void) fclose(file);
      (void) strcpy(image->filename,image_info->filename);
      image->temporary=True;
    }