2005.07.27 15:00 "[Tiff] User Defined Tags (TIFF_FLOAT)", by Randy

2005.07.27 15:00 "[Tiff] User Defined Tags (TIFF_FLOAT)", by Randy

Greetings All,

I'm attempting to add my own user-defined tags to tiff files that I write. I found the following example of how to do this online @ http://www.asmail.be/msg0054585832.html. I have implemented this and it works. However, when I try to change the field_passcount to FALSE, it does not seem to work. I'm using libtiff v. 3.7.3 on Windows XP. Here are the relevant code snippets that I have. If I take the code I have and replace TIFF_FLOAT with TIFF_LONG and float with long, everything works correctly. Float values are the only ones that appear to be broken. Any suggestions on what I might have done wrong? Thanks.

------------------

#define TIFFTAG_PV_TIMESTAMP                (TIFFTAG_PV_START + 2)

static const TIFFFieldInfo tExtraTiffFieldInfo[] = {
 {TIFFTAG_PV_INTEGRATION_TIME, 1, 1, TIFF_FLOAT, FIELD_CUSTOM, TRUE, FALSE,
"PV_IntegrationTime"},
 ...
};

// setting the floating point value
float fNumber = 123.0f;

TIFFSetField (pTiff, TIFFTAG_PV_INTEGRATION_TIME, fNumber);

// Getting the floating point value
float fNumber;

TIFFGetField (pTiff, TIFFTAG_PV_INTEGRATION_TIME, &fNumber)); // fNumber = 0.0f here.. which is not what it ought to be