CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003
    Posts
    2

    [LibTIFF] Reading TIFF tags

    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
    Last edited by Mournblade; March 10th, 2003 at 10:07 AM.

  2. #2
    Join Date
    Apr 1999
    Posts
    27,449
    Since the source code to LibTiff is available, why not compile the LibTiff source and debug it?

    Regards,

    Paul McKenzie

  3. #3
    Join Date
    Mar 2003
    Posts
    2
    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.

  4. #4
    Join Date
    Apr 1999
    Posts
    27,449
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured