AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2004.07.01 17:09 "[Tiff] StripOffsets to find the image data", by Penn Shan
2004.07.02 18:10 "Re: [Tiff] StripOffsets to find the image data", by Jim Schueckler

2004.07.02 18:10 "Re: [Tiff] StripOffsets to find the image data", by Jim Schueckler

Penn,

A TIFF image can be written in one great big strip or lots of smaller strips.

The last 4 bytes of a tiff tag may contain either the data or an offset to the data. If the data fits into 4 bytes, then the data must be in the tag. If the data is more than 4 bytes, then that 4 byte value is a long that is the offset to the data someplace else in the file.

If that file had only one strip, the image data would start at the offset defined in the tag, as you tried to do.

But that tag indicates there are 0xBC ( dec 188 ) strips, so the ARRAY of 188 LONG offsets starts at offset 182.

best wishes,
Jim

I have a question about using StripOffsets to find the image data. For example, if StripOffsets field looks like

(in Hex) 0111 0004 000000BC 000000B6 does it mean image data starts at 182? HEX(000000B6) = DECIMAL(182)

When I use this formular to locate image data, the first few pixels are incorrect. What I found is that the image data starts 272 byte after 182. So I am not sure exactly how to use StripOffsets to locate image data. Is the formular more complicated than this? Anyone has any idea?

Thank you,

Penn

Jim Schueckler  (585)726-6369       Professional Digital Cameras 1/205/KP
kmx-236-6369 fax(585)726-6669       Eastman Kodak Company MS 03010
mailto:James.Schueckler@kodak.com   2400 Mt Read Boulevard
http://www.kodak.com/go/kpdp        Rochester NY 14650-3010
"Oh! I have slipped the surly bonds of earth..." J.G. McGee