2002.08.22 22:17 "Problem Reading MultiPage TIFFs", by Steven Luke

2002.09.03 17:58 "RE: Problem Reading MultiPage TIFFs", by Frank Palmieri


1) To access the offset and byte counts directly, there is no API or interface. You can access them by using the internal structures of the tiff library assuming that they get loaded into those structures. Here's a fragment that shows including the private header files and some code to use them:

#include "tiffiop.h"    /* include private headers before public header */
#include "tif_dir.h"
#include "tiffio.h"
TIFF* in;
TIFFDirectory *td;

in = TIFFOpen(argv[1], "w");
td = &in->tif_dir;
printf("  %lu %s:\n", (long) td->td_nstrips,
       isTiled(out) ? "Tiles" : "Strips");
for (s = 0; s < td->td_nstrips; s++)
    printf("    %3lu: [%8lu, %8lu]\n",
           (u_long) s,
           (u_long) td->td_stripoffset[s],
           (u_long) td->td_stripbytecount[s]);

2) Reading fields is pretty well documented using the TIFFGetField() function. Use the tiffinfo & tiffdump utilities as examples. These would also be good samples to look at the data in your tiff file and modify to determine how well you can access the data with the information above.

Frank Palmieri frank@interscopetech.com 724-934-5770 x29