
Thread
2005.03.03 17:19 "[Tiff] LibTIFF question", by Kalman Miklos
Hi!
If there is someone out there who knows LibTIFF please reply: I am using LibTIFF I need to read tag information from a TIFF file. I know the code of the tag (it is not a standard tag) and I want to use GetField to retrieve the information stored in it. I can get the size of it, but cannot retrieve the value.
I open the file:
m_TIFF = TIFFOpen((char *)(LPCTSTR)m_FileName, "r");
...
I can read the width:
if (TIFFGetField(m_TIFF, TIFFTAG_IMAGEWIDTH, &ui32Val) == 0) {
m_Width = "n/a";
} else {
itoa(ui32Val, m_Width.GetBuffer(4), 10);
m_Width.ReleaseBuffer();
}
..
but I have a tagID 50653 with a length of 121 and I cannot read those bytes:
if (TIFFGetField(m_TIFF, 50653, &iVal) == 0) {
m_PtiOptions = "n/a";
} else {
itoa(iVal, m_PtiOptions.GetBuffer(4), 10);
m_PtiOptions.ReleaseBuffer();
}
...
Is there an easy way to get access to these 121 bytes maybe in a form of char buf[256], so I can later process this buffer?
Please help,
Thanks,
Miklos