AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
January 1997

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



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@eplrx7.es.dupont.com>

1997.01.23 02:03 "Re: Reading from standard in", by <cristy@eplrx7.es.dupont.com>

Tom Lane says:
> 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;
    }