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.09 17:26 "libtiff to write EPS preview -Reply", by <dprab@geiohio.com>
1997.01.10 23:28 "Re: libtiff to write EPS preview", by Niles Ritter
1997.01.11 02:04 "Re: libtiff to write EPS preview", by Phillip Crews

1997.01.10 23:28 "Re: libtiff to write EPS preview", by Niles Ritter

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.