Click to See Complete Forum and Search --> : [LibTIFF] Reading TIFF tags


Mournblade
March 10th, 2003, 09:01 AM
Hello !!

I have the following problem: I have difficulties reading tags from a TIFF file using the TIFFGetField() function. I can read without problems the TIFFTAG_IMAGEWIDTH, TIFFTAG_IMAGELENGTH, TIFFTAG_BITSPERSAMPLE, etc... tags, but I can't retrieve the TIFFTAG_STRIPOFFSETS tag. For example, when I try to read this tag, I get the value 3146512, when it should return 2000. What is odd, is that when I use the version 3.5.7 of LibTIFF, I get 3146512, and with the version 3.5.6 beta I get 1265600... and when I use fseek() + fread() I can easily retrieve the value I'm looking for.

Does anyone know what's happening here ? What am I doing wrong ??? I'd be very happy if someone has an idea to solve my problem, as I am quite lost right now. :)

Thanks

Paul McKenzie
March 10th, 2003, 10:26 AM
Since the source code to LibTiff is available, why not compile the LibTiff source and debug it?

Regards,

Paul McKenzie

Mournblade
March 10th, 2003, 10:56 AM
Originally posted by Paul McKenzie
Since the source code to LibTiff is available, why not compile the LibTiff source and debug it?

Regards,

Paul McKenzie

Hello Paul,

I did the compilation, but I did not find the function TIFFGetField() in the source code.

And as I am not a C ++ expert (i'm begining in the use of VC++), I'm learning the debuging. :)

Anyway, thanks for your answer. :)

Paul McKenzie
March 10th, 2003, 11:20 AM
LibTiff is a C library, not a C++ library. Did you search all of the headers and the .C (not .CPP) files? If you compiled it, then TiffGetField() is there, either as a function or it could be a macro.

Also, if you did compile it with debug info, all you need to do is put a breakpoint on the call to TiffGetField and just step into the function call. The debugger will go to the right place in the LibTiff code.

Regards,

Paul McKenzie