AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

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
2000.12.22 15:51 "Re: Libtiff's tiffcp and IFD's a newbie in trouble..", by Bård Kregnes

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

Frank Warmerdam wrote:

> Bård Kregnes wrote:

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.

Hack is good... :-)

        TIFFWriteCheck( out, TIFFIsTiled(out), "..." );

What should I put in ".."?

I waived thru the code, and saw the should be a module name..Didn't really figure out what stick in there... :-\

Sorry about this newbie stuff :-)

        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.

Ok, great!

Thx, for your help!

Bård
--
"Funny," he intoned funerally, "how just when you think life
can't possibly get any worse it suddenly does."