AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2006.12.20 13:24 "[Tiff] Interpreting values in tdir_offset of TIFFDirEntry", by mikk
2006.12.26 10:10 "Re: [Tiff] Interpreting values in tdir_offset of TIFFDirEntry", by Andrey Kiselev

2006.12.20 13:24 "[Tiff] Interpreting values in tdir_offset of TIFFDirEntry", by mikk

Hello,

I'm not sure I understand the way of interpreting values stored in the tdir_offset of TIFFDirEntry structure. According to the tiff.h comments for the TIFFDirEntry struct:

"...If the value is 4 bytes or less, then it is placed in the offset field to save space. If the value is less than 4 bytes, it is left-justified in the offset field."

When the IFD entry (a tag) is written into a TIFF file, and the data type size is 2 bytes (fe. TIFF_SHORT), and data length is 2, that makes 4 bytes of data. I assume that the data itself is saved in the tdir_offset field. And what if the data type size is 1 byte (fe. TIFF_ASCII or TIFF_BYTE) and data length is less than or equal to 4? I assume that the data itself is saved in the tdir_offset. Am I right?

Thanks in advance,

mikk