Received: from sgi.sgi.com (192.48.153.1) by cerious.com
 with SMTP (Apple Internet Mail Server 1.1.1); Fri, 10 Jan 1997 19:59:05 -0500
Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by sgi.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA02070; Fri, 10 Jan 1997 16:53:42 -0800
Received: (from daemon@localhost) by cthulhu.engr.sgi.com (950413.SGI.8.6.12/960327.SGI.AUTOCF) id XAA09290 for tiff-list; Fri, 10 Jan 1997 23:31:40 GMT
Received: from sgi.sgi.com (sgi.engr.sgi.com [192.26.80.37]) by cthulhu.engr.sgi.com (950413.SGI.8.6.12/960327.SGI.AUTOCF) via ESMTP id PAA09243 for <tiff-relay@relay.engr.sgi.com>; Fri, 10 Jan 1997 15:31:35 -0800
Received: from eis-net-002.jpl.nasa.gov (eis-net-002.jpl.nasa.gov [137.78.57.20]) by sgi.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA15118 for <tiff@sgi.com>; Fri, 10 Jan 1997 15:31:28 -0800
Received: from tazboy.JPL.NASA.GOV (tazboy.jpl.nasa.gov [128.149.24.99]) by eis-net-002.jpl.nasa.gov (8.7.5/8.7.3) with SMTP id PAA16276; Fri, 10 Jan 1997 15:31:24 -0800 (PST)
Received: by tazboy.JPL.NASA.GOV (4.1/SMI-4.1+DXRs2.3)
	id AA00628; Fri, 10 Jan 97 16:28:37 TAN
Date: Fri, 10 Jan 97 16:28:37 TAN
From: ndr@tazboy.jpl.nasa.gov (Niles Ritter)
Message-Id: <9701102328.AA00628@tazboy.JPL.NASA.GOV>
To: tiff@sgi.com
Subject: Re:  libtiff to write EPS preview 
Cc: dprab@GEIOHIO.COM
Sender: owner-tiff@relay.engr.SGI.COM
Precedence: bulk
Status: R

dprab@GEIOHIO.COM continues a conversation:

>  I've used the TIFF library successfully to write EPS with TIFF preview.
>  First write out the 30 byte header leaving the TIFF position and size
>  blank.  Write out the EPS and close the file.  Now open the file again with
>  the TIFF library and start writing the TIFF at the end of the file.  Record
>  the start position and end position of the TIFF to fill into the 30 byte
>  header. You might have to make some changes with the TIFF library and
>  using the 'a' option when opening the file.

From the discussions I surmise that there is a practice to insert a
TIFF preview inside an EPS file. I hope that this is well documented,
as it makes me nervous, and sounds very fragile. 

The problem is that TIFF is a *file* format, not a *stream* protocol,
is not easily streamable, and the format is based on
absolute file-offsets, not relative. Suppose I try to
hack the libtiff library to append a TIFF file to the end of an EPS.
What should it use for the offset to the first image directory:
the absolute location in the EPS file, or the offset relative
to the TIFF header? If you dont use the absolute location in
the file, then passing the TIFF image directory to a naive
TIFF file reader will fail when it seeks to the wrong location.
On the other hand, if you use the absolute location then
you will never be able to extract it from the EPS file,
since the locations will all be wrong (and no one wants to
reset all those StripOffset values, do they?).

Sounds bad in either case, although the header-relative
approach seems like the "better" alternative. A minimally
hacked libtiff file in "a" mode would probably generate
absolute offsets, unfortunately, since it uses seeks to compute
the locations of things.

Just out of curiosity, which approach is specified in EPS?

  --Niles.
