1997.01.08 22:25 "libtiff to write EPS preview", by Chuck Packard
Great library! I am using it to produce TIFF images of MATLAB graphics at 300 dpi. The marketing guys just love this stuff. Makes for eye catching collateral!
Well, I of course did not write without a question. Or maybe it is an enhancement request. I want to also use libtiff to output a TIFF preview for an EPS file. To do that, I have to output the PostScript and then the TIFF to the same file; along with a 30 byte header that precedes both. Looks like I can call TIFFOpen with 'a' to tack the TIFF onto the EPS file. But I also need to specify the length of the TIFF image in the header.
How can one find out how many bytes were written out for a TIFF image? If I use no compression, then it is just width * height * 3 + H, were H is some amount of TIFF header (tag) information. Anyone know what H is?
What if I do use packbits compression; how long is the file then? I guess what would be great is some function I can call after TIFFClose that tells me how many bytes were written out. When I looked at the code for PackBitsEncodeI do not see any magical global keeping track of how many bytes are being written out with each encoded strip. So I do not see an easy modification to get at this information. Anyone ever look into this? Anyone else need this?
Chuck Packard Tel: 508.647.7311
The MathWorks, Inc. Fax: 508.647.7002
email@example.com WWW: www.mathworks.com
"Our experts describe you as an appallingly dull fellow,
unimaginative, timid, lacking in initiative, spineless,
easily dominated, no sense of humor, tedious company, and
irrepressibly drab and awful, and whereas in most
professions, these would be considerable drawbacks, in
software engineering, they're a positive boon!"
Paraphrased Monty Python