2000.12.22 11:20 "Libtiff's tiffcp and IFD's a newbie in trouble..", by Bård Kregnes

2000.12.22 15:00 "Re: Libtiff's tiffcp and IFD's a newbie in trouble..", by Frank Warmerdam

I've runned into 'abscure' problem: The tiff-viewer which is integrated in the application software will _only_ 'view' tiff's where: (from tiffinfo) TIFF Directory at offset 0x8.

Senario: Tiff produced from the OCR software produce a tiff where the offset is 0x8. But when I run tiffcp on this file I get: (from tiffinfo) TIFF Directory at offset 0x1ac4. And the application isn't able to show the image.

Yes, I know: switch viewer. But it's an old applicaton and so on..

What I hoped to do: Rewrite/modify tiffcp to force the TIFF Directory offset to start at 0x8.

Bard,

It's a hack, but you can accomplish this by adding the following lines just before the "cf = pickCopyFunc..." stuff in tiffcp.

        TIFFWriteCheck( out, TIFFIsTiled(out), "..." );
        TIFFWriteDirectory( out );
        TIFFSetDirectory( out, 0 );

This forces the directory to be written and reread before any data has been written, so it appears at offset 8.

Best regards,

---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerda@home.com
light and sound - activate the windows | http://members.home.com/warmerda
and watch the world go round - Rush    | Geospatial Programmer for Rent


Editor's note: This mail was not originally archived, and has been reconstructed from quotes.